The prompt changes to match the name of the database you’re connecting to. To see what’s inside a database, connect to it using \c followed by the database name. Use \x on for narrower listings: /* Turn on narrow listings. CommandĮxample: Here’s an expanded listing: /* List all databases. Whether table listings use a wide or narrow format. Use \x (X for eXpanded listing) to control To get additional information on the space consumed by database tablesĪnd comments describing those tables, use \l+: postgres=# \l+ \l+ List databases with size, tablespace, and description For example, to view information about the template0 database:. You can get info on a single database by following the \l prompt with its name. Tom | tom | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + Template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + Postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Markets | tom | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Visitor | tom | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Name | Owner | Encoding | Collate | Ctype | Access privileges To get a list of all databases: postgres=# \l Some of these databases (and the tables within) are updated automatically by PostgreSQL as you use them. A database is a set of tables, information about those tables, information about users and their permissions, and much more. What most people think of as a database (say, a list of customers) is actually a table. You’ll get help on just that item: Command: DROP TABLEĭROP TABLE name
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |