skip to Main Content

On my postgres database, I have some tables that were created on the wrong schema ("ag_catalog") and I decided to drop it anyway since it was just for testing. I had also installed the age extension, but then I dropped it with DROP EXTENSION age;. When I tried dropping the "ag_catalog" schema, the terminal showed the following error:

demo=# DROP SCHEMA ag_catalog CASCADE;
NOTICE:  drop cascades to 3 other objects
DETAIL:  drop cascades to table polls
drop cascades to table options
drop cascades to table votes
ERROR:  table "ag_label" does not exist

I tried creating the extension again and executing the same command to drop the schema, but now it shows another error:

demo=# DROP SCHEMA ag_catalog CASCADE;
NOTICE:  drop cascades to 4 other objects
DETAIL:  drop cascades to table polls
drop cascades to table options
drop cascades to table votes
drop cascades to extension age
ERROR:  index "ag_label_relation_index" does not exist

2

Answers


  1. There are errors occuring when you try to access and operate on the ag tables directly. I recommend you delete the extension library from postgres probably in the /usr/local/<enter_postgres_directory>/lib/ and delete the age.so file and try again.

    If that doesn’t work you (and you don’t have any valuable data) you can delete the initdb file and initializing the database again.

    Worst case reinstall postgres and the extension.

    Login or Signup to reply.
  2. Execute this command in the Apache AGE local directory:

    sudo make PG_CONFIG=/path_to_postgres/bin/pg_config clean
    

    Then, you have two options: either try dropping the schema again or delete age.so in the Postgres lib directory and then drop the schema.

    Another possibility is to restore the database. Please follow the steps outlined on here to do so.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search