Re: Listing table definitions by only one command - Mailing list pgsql-sql

From Wes James
Subject Re: Listing table definitions by only one command
Date
Msg-id CAFjCMHv0Kvi_nj2ezDGotD1=knTwQjXY2i_P9FRvUWskdYmrYA@mail.gmail.com
Whole thread Raw
In response to Listing table definitions by only one command  (Carla Goncalves <cgourofino@hotmail.com>)
List pgsql-sql



On Wed, Jul 17, 2013 at 9:29 AM, Carla Goncalves <cgourofino@hotmail.com> wrote:
Hi
I would like to list the definition of all user tables by only one command. Is there a way to *not* show pg_catalog tables when using "\d ." in PostgreSQL 9.1.9?

Thanks.

I didn't see a way to do that with \ commands, but found this with a google search:

SELECT
N.nspname,
C.relname,
A.attname,
pg_catalog.format_type(a.atttypid, a.atttypmod) AS typeName
FROM
pg_class C,
pg_namespace N,
pg_attribute A,
pg_type T
WHERE
(C.relkind='r') AND
(N.oid=C.relnamespace) AND
(A.attrelid=C.oid) AND
(A.atttypid=T.oid) AND
(A.attnum>0) AND
(NOT A.attisdropped) AND
(N.nspname ILIKE 'public')
ORDER BY
C.oid, A.attnum;

wes

pgsql-sql by date:

Previous
From: Carla Goncalves
Date:
Subject: Listing table definitions by only one command
Next
From: Giuseppe Broccolo
Date:
Subject: Re: Listing table definitions by only one command