Re: Re: Newbie question: How to check how many tables avaliable at that database?

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: Newbie question: How to check how many tables avaliable at that database?
Date: 2001-06-21 18:37:03
Message-ID: 20010621133703.B7582@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 13, 2001 at 07:25:46PM +0200, Nils Zonneveld wrote:
>
>
> Carfield Yim wrote:
> >
> > I am a new user of PostgreSQL dbms, how can I check how many tables
> > avaliable at that database?
>
> To get a list of tables through SQL:
>
> SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%' ORDER BY tablename;
>
> To get the number of tables through SQL:
>
> SELECT count(*) FROM pg_tables WHERE tablename NOT LIKE 'pg_%';

to learn more of these tricks, start 'psql' with '-E' as in

psql -E mydatabasenamehere

then when you give any '\d' command you'll see the sql behind
the scenes that does the work.

also try '\?' for more info on using psql.

--
I figure: if a man's gonna gamble, may as well do it
without plowing. -- Bama Dillert, "Some Came Running"

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-06-21 18:54:45 Re: [Help] Temporary Table: Implicitely created index not shown in \d i
Previous Message will trillich 2001-06-21 18:35:30 Re: Moving rows to another database