Thread: view database, tables, columns

view database, tables, columns

From
e-letter
Date:
Readers,

I've created a database. I couldn't find any documentation to help me
with the following questions.

How do I see a list of the names of databases that I've created?
How do I see the name of the table(s) of a database?
How do I see the names of columns within a table?

I can see the information using the program pgadmin 3, but I want to
learn how to see this information from the command terminal.

Yours,



postgresql 826
mandriva 2007

postgresqlnovice@conference.jabber.org

Re: view database, tables, columns

From
"A. Kretschmer"
Date:
am  Sun, dem 27.01.2008, um  9:24:57 +0000 mailte e-letter folgendes:
> Readers,
>
> I've created a database. I couldn't find any documentation to help me
> with the following questions.
>
> How do I see a list of the names of databases that I've created?
> How do I see the name of the table(s) of a database?
> How do I see the names of columns within a table?
>
> I can see the information using the program pgadmin 3, but I want to
> learn how to see this information from the command terminal.

Start the command-terminal, psql, and read:

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit



Try this commands, and special for your questions:

list of databases: \l
list of tables: \d
list of columns within a table: \d <table>


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net