Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 819
eonil Avatar asked Mar 06 '13 02:03

eonil


1 Answers

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=#  
like image 101
eonil Avatar answered Sep 23 '22 00:09

eonil