Re: How can I get the Db Schema Info??

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Rajan Bhide <rbhide(at)nulinkinc(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org, Ritesh Kumar Kakar <rkakar(at)nulinkinc(dot)com>
Subject: Re: How can I get the Db Schema Info??
Date: 2004-08-12 06:52:34
Message-ID: 20040812065234.GA28478@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Aug 12, 2004 at 11:21:30 +0530,
Rajan Bhide <rbhide(at)nulinkinc(dot)com> wrote:
> Hi,
>
> I have a query regarding the SCHEMA INFORMATION.
> I require following information about a database i.e
> 1)How many tables are there?
> 2)What are their names?
> 3)What are the column types in each of the tables?
> 4)Primary key and foreign key information about a specific table.
>
> This information is available by running commands like \d <table name>,
> but what if
> I want to execute a query to get this information.
> i.e. I need the result in the recordset format for which I am require to
> execute the query.
> So, are there any sysobjects, System tables which stores the catalog
> information?

If you use the -E option on psql you can see what queries it uses to
get the information. Much of this information is available through
the information schema. The postgres documentation has both information
about the system tables and the information schema.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Steve Tucknott 2004-08-12 07:56:51 Admin tools
Previous Message Rajan Bhide 2004-08-12 05:51:30 How can I get the Db Schema Info??