Re: TODO: Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(), - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Re: TODO: Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(),
Date
Msg-id 448CA62F.9020301@commandprompt.com
Whole thread Raw
In response to Re: TODO: Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(),  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: TODO: Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(),  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: TODO: Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(),  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
>> CREATE TABLE foo (id serial);
>>
>> I mean, I can do either but I would like to get a clear definition of 
>> what we are looking for here. Maybe:
>>
>> pg_get_tabledef is the actual SQL and pg_get_tabledesc() is the column, 
>> datatype output?
>>
>> I guess I don't see the advantage of putting pg_dump -s -t in the backend.
> 
> If all you want is column, datatype, why not just use info_schema, or
> newsysviews? Or even the base catalogs?

Where do I look in the info_schema? How do I know exactly what I need? 
What is newsysviews?

Of course I know the answers to these but many people don't. Newsysviews 
is a no-op unless it is in the backend (will it be for 8.2?). Secondly 
in a email I just sent I did say we can add anything we want, but the 
CREATE TABLE statement doesn't seem that useful.

I will create either or both I don't really care :).

> ISTM what would be of the most value is a way to get the actual DDL you
> need to create the table (which includes a heck of a lot more than just
> column names and data types).

Name and datatype was just an example. I am trying to get people to 
actually provide feedback (thank you). Andrew brought up that also 
including the constraints would be a good idea which I agree.

Joshua D. Drake


-- 
            === The PostgreSQL Company: Command Prompt, Inc. ===      Sales/Support: +1.503.667.4564 || 24x7/Emergency:
+1.800.492.2240     Providing the most comprehensive  PostgreSQL solutions since 1997
http://www.commandprompt.com/




pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: TODO: Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(),
Next
From: Tom Lane
Date:
Subject: Re: postgresql and process titles