Re: pg_get_constraintdef - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_get_constraintdef
Date
Msg-id 17925.1042429943@sss.pgh.pa.us
Whole thread Raw
In response to pg_get_constraintdef  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: pg_get_constraintdef  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.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_constraintstores.
 

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


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: pg_get_constraintdef
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: pg_get_constraintdef