From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com> |
Cc: | "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: TODO: Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(), |
Date: | 2006-06-11 18:50:36 |
Message-ID: | 448C65FC.3060506@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Joshua D. Drake wrote:
>>
>> Well, the argument against changing pg_dump is that it would impact the
>> ability to use the newer version of pg_dump with older backends (which
>> would be lacking these functions).
>>
>> ISTM what would be best is to add the functions to the backend, and add
>> a TODO or comments to pg_dump indicating that it should be changed to
>> use these functions once 8.1 is no longer supported. Or you could make
>> pg_dump's use of this code dependent on the server version it connected
>> to.
>
>
> Off list I was speaking with AndrewD and he said that he would expect
> that if we called pg_get_tabledef() it should return the CREATE
> statement for the table.
>
> With all due respect to Andrew, why? At least in my mind these
> functions really belong to app developers.. e.g;
>
> CREATE TABLE foo (id serial);
>
> SELECT pg_get_tabledef(foo) would return
>
> id, serial
>
> Not:
>
> 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.
>
>
Well, I certainly don't think a setof <name, type> is adequate for
pg_get_tabledef(). What about constraints? And what you are suggesting
can probably be got by very simple queries against either the catalog or
the information schema, and seems to me to have little value.
As for whether or not it belongs in the backend, I don't have strong
feelings - maybe we could add what I'm suggesting as some \ commands in
psql - that would certainly be adequate for the purpose I had in mind,
but might not suit users of higher end design tools.
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-06-11 18:57:38 | Re: longjmp in psql considered harmful |
Previous Message | Martijn van Oosterhout | 2006-06-11 18:24:56 | Re: Ranges for well-ordered types |