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

Re: Query a list of tables

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Campbell, Lance" <lance(at)illinois(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Query a list of tables
Date: 2008-07-23 15:02:03
Message-ID: dcc563d10807230802l6e2035fchabfc8d2d8c317b65@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
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

In response to

Responses

pgsql-admin by date

Next:From: Gibson ChimhamhiwaDate: 2008-07-23 15:10:11
Subject: Re: Query a list of tables
Previous:From: Campbell, LanceDate: 2008-07-23 14:56:22
Subject: Query a list of tables

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