Is there some reason why pg_get_constraintdef only supports Foreign Key
constraints?  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...?

Chris


Mon, 13 Jan 2003 11:25:02 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
pg_get_constraintdef
"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_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

Sun, 12 Jan 2003 22:52:23 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: pg_get_constraintdef 
> "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_constraint stores.
>
> Feel free to contribute some code.

I will, but unfortunately the damage has already been done...since I have to
support 7.3 anyway, fixing the above problem will actually make my life
harder, not easier...

Chris


Mon, 13 Jan 2003 11:59:33 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: pg_get_constraintdef 
On Mon, Jan 13, 2003 at 11:59:33AM +0800, Christopher Kings-Lynne wrote:
>Tom Lane writes:
> >
> > Feel free to contribute some code.
> 
> I will, but unfortunately the damage has already been done...since I have to
> support 7.3 anyway, fixing the above problem will actually make my life
> harder, not easier...

Yeah, but never let that stop you from doing the right thing. Heck,
isn't that almost a diagnostic for 'the right thing', "Hmm, this is easy:
I must be doing something wrong." ;-)

Ross

Mon, 13 Jan 2003 08:59:14 -0600
"Ross J. Reedstrom" <reedstrm@rice.edu>
Re: pg_get_constraintdef


> On Mon, Jan 13, 2003 at 11:59:33AM +0800, Christopher Kings-Lynne wrote:
> >
> > I will, but unfortunately the damage has already been done...since I
have to
> > support 7.3 anyway, fixing the above problem will actually make my life
> > harder, not easier...

Another issue to consider is that when a dump from 7.2 is loaded into 7.3
no foreign keys are listed in pg_constraint, so some backwards
compatibility will be required because even if the 7.3 server supports
this functionality it does not mean it is being used.

Kris Jurka



Mon, 13 Jan 2003 13:01:49 -0500 (EST)
Kris Jurka <books@ejurka.com>
Re: pg_get_constraintdef