Re: pg_get_constraintdef

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_get_constraintdef
Date: 2003-01-13 03:52:23
Message-ID: 17925.1042429943@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
> Is there some reason why pg_get_constraintdef only supports Foreign Key
> constraints?

Lack of implementation effort --- the original definition/implementation
was FK-specific, but now, as the code says,

* XXX The present implementation only works for foreign-key constraints, but
* it could and should handle anything pg_constraint stores.

Feel free to contribute some code.

> Why not have it output ALTER TABLE commands for UNIQUE and
> PRIMARY KEY constraints? That would make my life so much easier for
> phpPgAdmin and also pg_dump could be simplified quite considerably...?

I do not think pg_dump would gain anything much, since it has to be able
to deal with older servers.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-01-13 03:59:33 Re: pg_get_constraintdef
Previous Message Christopher Kings-Lynne 2003-01-13 03:25:02 pg_get_constraintdef