Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4AEF565020B for ; Wed, 23 Jul 2008 12:21:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 87478-07 for ; Wed, 23 Jul 2008 12:21:42 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.169]) by postgresql.org (Postfix) with ESMTP id 66B00650218 for ; Wed, 23 Jul 2008 12:21:42 -0300 (ADT) Received: by wf-out-1314.google.com with SMTP id 25so1887913wfc.28 for ; Wed, 23 Jul 2008 08:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=2dvBkr8ymANV7el9u23/v0CenqejIkCO2mAJXDIVqf8=; b=Jt/vWJ16wWukN2CTIhZ9U02XyZvGtbtD7vb2sQ9b7H9nr9Sm6unPEby455QQEWQ3CY XwdL+juuhzl8Hs8V3idj4i9nB2CwC5ddFXMON6OVUe6rC2np3sZG3WaI4C22Mipie8xt xg21Kg3AeB7zCXER5XjpsdP6Cv9caSdOvHqrM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=GV4h/0AJRtDfyCHAomxQYTPaFqyNTHav2PuIRwnU3OmWp/9QL87Bq2BmBgnK4XUvcw WntitNTHF2+d/BdFrHmwscY5cpH1x6XuUC1Pw4Jdf+r0VyygmIYYaoD6rZZdGvwvfe4I kerbwx1pwkeY/qHbkiwO/thuKc0kswCXq6S3M= Received: by 10.142.240.19 with SMTP id n19mr43152wfh.191.1216826501399; Wed, 23 Jul 2008 08:21:41 -0700 (PDT) Received: by 10.143.18.15 with HTTP; Wed, 23 Jul 2008 08:21:41 -0700 (PDT) Message-ID: Date: Wed, 23 Jul 2008 17:21:41 +0200 From: "Gibson Chimhamhiwa" To: pgsql-admin@postgresql.org Subject: Re: Query a list of tables In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_74841_9222852.1216826501404" References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/195 X-Sequence-Number: 29805 ------=_Part_74841_9222852.1216826501404 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Under Schema I have; information_schema pg_catalog pg_toast pg_toast_temp_1 pg_temp_1 and then public which contains the tables with data for my database. On Wed, Jul 23, 2008 at 5:11 PM, Campbell, Lance wrote: > Is there a list somewhere of the system catalog tables and examples of > querying it for administrative reasons? > > -----Original Message----- > From: Scott Marlowe [mailto:scott.marlowe@gmail.com] > Sent: Wednesday, July 23, 2008 10:02 AM > To: Campbell, Lance > Cc: pgsql-admin@postgresql.org > Subject: Re: [ADMIN] Query a list of tables > > On Wed, Jul 23, 2008 at 8:56 AM, Campbell, Lance > wrote: > > What is the SQL to do the following: > > > > > > > > 1) Return a list of all possible SCHEMA names within a database. > > > > 2) For a given SCHEMA return the list of all table names. > > You can either do it with the INFORMATION_SCHEMA, or the system > catalogs. To see how to do it with the system catalogs, then start > psql with the -E switch and issue \dn and set search_path='schemaname' > and \d > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > -- Gibson Chimhamhiwa CSIR - Meraka Institute P O Box 395, Pretoria 0001 South Africa www.csir.co.za / www.meraka.org.za Office: +27 12 841 2758 Mobile: +27 78 447 2879 Fax: +27 12 841 4720 E-mail:gchimhamhiwa@gmail.co.za ------=_Part_74841_9222852.1216826501404 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

Hi,

Under Schema I have;

information_schema
pg_catalog
pg_toast
pg_toast_temp_1
pg_temp_1

and then public which contains the tables with data for my database.

On Wed, Jul 23, 2008 at 5:11 PM, Campbell, Lance <lance@illinois.edu> wrote:
Is there a list somewhere of the system catalog tables and examples of
querying it for administrative reasons?

-----Original Message-----
From: Scott Marlowe [mailto:scott.marlowe@gmail.com]
Sent: Wednesday, July 23, 2008 10:02 AM
To: Campbell, Lance
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Query a list of tables

On Wed, Jul 23, 2008 at 8:56 AM, Campbell, Lance <lance@illinois.edu>
wrote:
> What is the SQL to do the following:
>
>
>
> 1)      Return a list of all possible SCHEMA names within a database.
>
> 2)      For a given SCHEMA return the list of all table names.

You can either do it with the INFORMATION_SCHEMA, or the system
catalogs.  To see how to do it with the system catalogs, then start
psql with the -E switch and issue \dn and set search_path='schemaname'
and \d

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



--
Gibson Chimhamhiwa
CSIR - Meraka Institute
P O Box 395, Pretoria 0001
South Africa
www.csir.co.za / www.meraka.org.za
Office: +27 12 841 2758
Mobile: +27 78 447 2879
Fax: +27 12 841 4720
E-mail:gchimhamhiwa@gmail.co.za
------=_Part_74841_9222852.1216826501404--