Обсуждение: Looking at a table

Поиск
Список
Период
Сортировка

Looking at a table

От
"Paul Ottar Tornes"
Дата:
I have a database named "maloy" and within that I have a table named "nyheter"
I can do psql -l to look at all the databases and owners. But is there a way to look at the contents of the table "nyheter" in the database "maloy" ?
 
Regards
Paul Ottar Tornes

Re: Looking at a table

От
Neil Conway
Дата:
"Paul Ottar Tornes" <critical@tiscali.no> writes:
> I can do psql -l to look at all the databases and owners. But is
> there a way to look at the contents of the table "nyheter" in the
> database "maloy" ?

\d nyheter when connected to the "maloy" database, perhaps? If you'd
like to see the SQL that psql uses to produce that info, start psql
with the "-E" flag.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Re: Looking at a table

От
"scott.marlowe"
Дата:
On Wed, 30 Oct 2002, Paul Ottar Tornes wrote:

> I have a database named "maloy" and within that I have a table named "nyheter"
> I can do psql -l to look at all the databases and owners. But is there
> a way to look at the contents of the table "nyheter" in the database
> "maloy" ?

psql nyheter -c -- 'select * from maloy'

should do it.