Re: Data Dictionary generator?

From: "codeWarrior" <gpatnude(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Data Dictionary generator?
Date: 2005-11-03 16:02:09
Message-ID: dkdc5k$1itj$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

SELECT

isc.table_name,
isc.ordinal_position::integer AS ordinal_position,
isc.column_name::character varying AS column_name,
isc.column_default::character varying AS column_default,
isc.data_type::character varying AS data_type,
isc.character_maximum_length::integer AS str_length,
CASE
WHEN isc.udt_name::text = 'int4'::text OR isc.udt_name::text =
'bool'::text THEN isc.data_type::character varying
ELSE isc.udt_name::character varying
END AS udt_name

FROM information_schema.columns isc
WHERE isc.table_schema::text = 'public'::text
ORDER BY isc.table_name, isc.ordinal_position;

"Patrick Hatcher" <PHatcher(at)macys(dot)com> wrote in message
news:OF3278EBDC(dot)8EACE142-ON882570AD(dot)0080A52D-882570AD(dot)0081F34C(at)FDS(dot)com(dot)(dot)(dot)
>
>
> I need to generate a data dictionary for all my tables (name, column,
> type, etc) in my database. Is there an easy to do this without having to
> do a \d tablename for each table?
> tia
> Patrick
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aly Dharshi 2005-11-03 16:12:30 Re: question about Postgresql and rsync
Previous Message Cristian Prieto 2005-11-03 16:01:30 Save prepared plan...