Re: accessing user table structures from SQL

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Vincent Predoehl" <vpredoehl(at)phoenixwebgroup(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: accessing user table structures from SQL
Date: 2009-01-17 07:40:48
Message-ID: dcc563d10901162340g5a757474yb1754159d5e341f2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 16, 2009 at 9:32 PM, Vincent Predoehl
<vpredoehl(at)phoenixwebgroup(dot)com> wrote:
> Does postgresql have a system table that has the table structure of user
> tables, like systables and sysobjects in MS SQL Server?

There's the pg_* views and tables that have all of that, and to see
how they work, you can run psql -E and then any \ command you issue
you'll get to see the SQL for.

OR you can look at the information_schema which is a SQL standard but
I think there are some pg relationships it can't show.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-01-17 08:08:52 Re: Trigger to clone across databases?
Previous Message Faheem Mitha 2009-01-17 07:09:38 array_agg for 8.3