Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why command \dt gives - no relations found?

Tags:

postgresql

I have created a database in postgres. It has 3 empty tables. The table has user tom as its Superuser along with root. I am logged in as tom and connected to mydb database. But still the commands \d or \dt - gives no relations found.

Is there any alternate to SHOW TABLE in postgresql?

Could not find solution here

I get results from - \dt *.*.

like image 273
Sp1 Avatar asked Nov 29 '16 12:11

Sp1


People also ask

What is the PSQL command to show the schema of a relation?

To show the name of the current schema, use the following simple command. >> SELECT current_schema(); This shows that the current schema is “public”.

How do I show all databases in PostgreSQL?

Use \l or \l+ in psql to show all databases in the current PostgreSQL server. Use the SELECT statement to query data from the pg_database to get all databases.

How do I get out of Postgres prompt?

Type \q and then press ENTER to quit psql . As of PostgreSQL 11, the keywords " quit " and " exit " in the PostgreSQL command-line interface have been included to help make it easier to leave the command-line tool.


1 Answers

It is not a problem with your search_path, it could be an issue with your schema permissions as described in the answer here. Check with \dn+ that the public schema indicates permissions for the postgres role, and if not, grant them with: GRANT ALL ON SCHEMA public TO public;

like image 124
HorsePunchKid Avatar answered Sep 28 '22 09:09

HorsePunchKid