Re: database structure

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Alex Zavalin <a-l-x(at)mail(dot)od(dot)ua>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: database structure
Date: 2002-11-22 19:05:52
Message-ID: Pine.LNX.4.33.0211221202170.25574-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 22 Nov 2002, Alex Zavalin wrote:

> Hello,
>
> Is there a simpler way of getting a PostgreSQL database structure than
> reading system catalogs pg_tables, pg_attributes, pg_class, pg_type,
> pg_index etc.? I need to get information about tables, attributes,
> data types, primary and foreign keys.

The simple answer, uh, sorta, using psql's \ commands. The long answer is
to take the code that psql's \ commands use and make a view out of them.

I.e. do 'psel -E database'
then '\d tablename'
Then take the sql statements and make views out of them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Don Isgitt 2002-11-22 19:14:26 Re: Lack of use of indexes
Previous Message Tom Lane 2002-11-22 19:02:38 Re: Unwanted Log Entries