I created person table as shown below:
CREATE TABLE person (
id INTEGER,
name VARCHAR(20)
);
Then, trying to show the definition of person table with \d and \d+ got the error as shown below:
postgres=# \d person
ERROR: relation "pg_catalog.pg_roles" does not exist
LINE 2: ...catalog.array_to_string(array(select rolname from pg_catalog...
postgres=# \d+ person
ERROR: relation "pg_catalog.pg_roles" does not exist
LINE 2: ...catalog.array_to_string(array(select rolname from pg_catalog...
*Memos:
I use PostgreSQL
16.0on Windows 11:I referred to the doc and the answer which gets the highest upvotes.
I also referred to
\?on psql as shown below:postgres=# \? ... Informational ... \d[S+] NAME describe table, view, sequence, or index ...
In addition, trying to show pg_catalog.pg_roles got the error as shown below:
postgres=# SELECT * FROM pg_catalog.pg_roles;
ERROR: relation "pg_catalog.pg_roles" does not exist
LINE 1: SELECT * FROM pg_catalog.pg_roles;
So, how can I solve the errors?
Your database is corrupted. Restore a backup.