Denys_newbie
Denys_newbie

Reputation: 1160

PostgresSQL \d command tells about not existing table

When I type \l into psql I got

                                                 List of databases
   Name    |  Owner   | Encoding |          Collate           |           Ctype            |   Access privileges
-----------+----------+----------+----------------------------+----------------------------+-----------------------
 postgres  | postgres | UTF8     | English_United States.1251 | English_United States.1251 |
 template0 | postgres | UTF8     | English_United States.1251 | English_United States.1251 | =c/postgres          +
           |          |          |                            |                            | postgres=CTc/postgres
 template1 | postgres | UTF8     | English_United States.1251 | English_United States.1251 | =c/postgres          +
           |          |          |                            |                            | postgres=CTc/postgres

So here I have 1 database names postgres, but if I type \d I got

        List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+----------
 public | db1  | table | postgres
(1 row)

In pgAdmin I can see 1 database named "postgres", so why \d tells me about db1 database? (I created it earlier and dropped)

Upvotes: 1

Views: 47

Answers (1)

ThiefMaster
ThiefMaster

Reputation: 318488

From the psql help:

Informational
  (options: S = show system objects, + = additional detail)
  \d[S+]                 list tables, views, and sequences

And as your output shows, db1 is a table, not a database...

DROP TABLE db1; will get rid of it.

Upvotes: 2

Related Questions