Why psql can't find relation name for existing table?

PostgresqlSchemaPsql

Postgresql Problem Overview


Here' my current state.

Eonil=# \d+
                       List of relations
 Schema |    Name    | Type  | Owner |    Size    | Description 
--------+------------+-------+-------+------------+-------------
 public | TestTable1 | table | Eonil | 8192 bytes | 
(1 row)

Eonil=# \d+ TestTable1
Did not find any relation named "TestTable1".
Eonil=# 

What is the problem and how can I see the table definition?

Postgresql Solutions


Solution 1 - Postgresql

Postgres psql needs escaping for capital letters.

Eonil=# \d+ "TestTable1"

So this works well.

Eonil=# \d+ "TestTable1"
                   Table "public.TestTable1"
 Column |       Type       | Modifiers | Storage  | Description 
--------+------------------+-----------+----------+-------------
 ID     | bigint           | not null  | plain    | 
 name   | text             |           | extended | 
 price  | double precision |           | plain    | 
Indexes:
    "TestTable1_pkey" PRIMARY KEY, btree ("ID")
    "TestTable1_name_key" UNIQUE CONSTRAINT, btree (name)
Has OIDs: no

Eonil=# 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioneonilView Question on Stackoverflow
Solution 1 - PostgresqleonilView Answer on Stackoverflow