PostgreSQL 12 – Can’t See Table Details with \dt Command

postgresql

I have a custom schema and one table in it. Following answers about searching through custom schemas I have modified by search_path to include new schema.

I can see now all objects in the new schema, so this one works:

xekata_dev=> \dt
                List of relations
 Schema |     Name     | Type  |      Owner
--------+--------------+-------+-----------------
 xekata | TestNodeBase | table | xekata_user_web
(1 row)

Now when I want to see table details I do:

xekata_dev=> \d TestNodeBase
Did not find any relation named "TestNodeBase".

which shows nothing… 🙁

I tried different ways to but nothing works:

xekata_dev-> \d xekata.TestNodeBase
Did not find any relation named "xekata.TestNodeBase".

I am logged as xekata_user_web and my search_path is:

xekata_dev=> show search_path;
  search_path
----------------
 xekata, public

What's going on? Why I can't see table details?

Best Answer

You created a case sensitive table name (which is strongly discouraged) so now you need to use double quotes every time you access it:

\d xekata."TestNodeBase"

I highly recommend to stop using those dreaded quoted identifies. Forget that double quotes exists when dealing with SQL.