Jim C. Nasby wrote:
> On Mon, Jun 12, 2006 at 03:47:13PM +1200, Mark Kirkwood wrote:
>> Keeping 'em separate makes sense to me:
>>
>> 1/ API (or info schema views) provides the required data (e.g column
>> details for a table).
>> 2/ client (e.g. pg_dump) decides what to do with it (e.g. construct a
>> CREATE statement from the column details).
>
> Which means that every other client that wants to generate DDL
> statements has to go through a lot of work to get it right. And then
> they have to maintain it for every version of PostgreSQL.
>
> I think it makes a heck of a lot more sense to have a backend function
> to do this.
>
> Here's the relevant thread:
> http://archives.postgresql.org/pgsql-hackers/2005-12/msg00756.php
>
> The intention is to flesh out the existing pg_get_blahdef functions,
> such as pg_get_viewdef(). This clearly means that the functions should
> output a complete CREATE command.
>
Ok, good point, if I'm writing some admin or data movement package, then
these guys would be great!
I guess a possible compromise for those who want to keep the core
backend lean is to implement pg_get_blahdef (and friends) in a contrib
module similar to (or part of) the adminpack stuff.
This would mean that pg_dump would *not* use them - but if I've followed
this thread properly, that may be fine.
Best wishes
Mark