Re: sql syntax to replace desc

From: Martin Gainty <mgainty(at)hotmail(dot)com>
To: <penguinroad(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: sql syntax to replace desc
Date: 2009-01-31 02:38:46
Message-ID: BLU142-W12E437872C95C2694EEE0AAEC70@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


information_schema.table_name contains the tables information..make sure yuo select type BASE TABLE
and make sure the schema is not from either catalog or information_schema e.g.

SELECT table_name
FROM information_schema.tables
WHERE table_type = 'BASE TABLE'
AND table_schema NOT IN
('pg_catalog', 'information_schema')

HTH
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.

Date: Sat, 31 Jan 2009 09:20:27 +0700
Subject: [GENERAL] sql syntax to replace desc
From: penguinroad(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org

Dear all,

I need to see my table structure complete with it's constraint (at least primary key, foreign key, not null, unique)
In oracle or mysql, I usually use desc table_name to achieve such result
But I find from pgsql-doc that desc isn't implemented.

Does anyone know some sql syntax to do that?

I'm not talking about \d option at psql console since I need that data
to be called from programming language such as PHP and Ruby

Thank you
Regards

Hendra

_________________________________________________________________
Windows Live™ Hotmail®…more than just e-mail.
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_howitworks_012009

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Octavio Alvarez 2009-01-31 04:53:26 Re: Pet Peeves?
Previous Message Richard Broersma 2009-01-31 02:34:40 Re: sql syntax to replace desc