Skip site navigation (1) Skip section navigation (2)

Re: Query a list of tables

From: "Gibson Chimhamhiwa" <gchimhamhiwa(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Query a list of tables
Date: 2008-07-23 15:21:41
Message-ID: f2b0d8200807230821v754d478ck3e44925085662e80@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
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(at)illinois(dot)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(dot)marlowe(at)gmail(dot)com]
> Sent: Wednesday, July 23, 2008 10:02 AM
> To: Campbell, Lance
> Cc: pgsql-admin(at)postgresql(dot)org
> Subject: Re: [ADMIN] Query a list of tables
>
> On Wed, Jul 23, 2008 at 8:56 AM, Campbell, Lance <lance(at)illinois(dot)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(at)postgresql(dot)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(at)gmail(dot)co(dot)za <E-mail%3Agchimhamhiwa(at)gmail(dot)co(dot)za>

In response to

Responses

pgsql-admin by date

Next:From: Sergio Gabriel RodriguezDate: 2008-07-23 15:32:10
Subject: Catalog
Previous:From: Campbell, LanceDate: 2008-07-23 15:11:59
Subject: Re: Query a list of tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group