Thread: Foreign key in pg_dump / psql

Foreign key in pg_dump / psql

From
Rod Taylor
Date:
A couple of bits of the depend/constraint patch that were not applied.

It displays foreign key structure in /d while skipping the triggers that
make up the foreign key.

Dumps foreign keys as alter table statements on >=7.3.  Older DBs will
continue to dump triggers (no pg_constraint table).

Attachment

Re: Foreign key in pg_dump / psql

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Rod Taylor wrote:
> A couple of bits of the depend/constraint patch that were not applied.
>
> It displays foreign key structure in /d while skipping the triggers that
> make up the foreign key.
>
> Dumps foreign keys as alter table statements on >=7.3.  Older DBs will
> continue to dump triggers (no pg_constraint table).

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Foreign key in pg_dump / psql

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Your patch has been added to the PostgreSQL unapplied patches list at:

>> A couple of bits of the depend/constraint patch that were not applied.

Again, this is code I still gotta review...

            regards, tom lane

Re: Foreign key in pg_dump / psql

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Your patch has been added to the PostgreSQL unapplied patches list at:
>
> >> A couple of bits of the depend/constraint patch that were not applied.
>
> Again, this is code I still gotta review...

Oh, that one. OK.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Foreign key in pg_dump / psql

From
Rod Taylor
Date:
On Wed, 2002-08-14 at 10:05, Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Your patch has been added to the PostgreSQL unapplied patches list at:
>
> >> A couple of bits of the depend/constraint patch that were not applied.
>
> Again, this is code I still gotta review...

The attached better handles constraint triggers which are not foreign
keys.   It helps 7.2.

Is there any reason to create new constraint triggers?  Could the
CONSTRAINT clause be removed after a couple of releases?


Attachment

Re: Foreign key in pg_dump / psql

From
Bruce Momjian
Date:
[  Tom will review.]

Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Rod Taylor wrote:
> On Wed, 2002-08-14 at 10:05, Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Your patch has been added to the PostgreSQL unapplied patches list at:
> >
> > >> A couple of bits of the depend/constraint patch that were not applied.
> >
> > Again, this is code I still gotta review...
>
> The attached better handles constraint triggers which are not foreign
> keys.   It helps 7.2.
>
> Is there any reason to create new constraint triggers?  Could the
> CONSTRAINT clause be removed after a couple of releases?
>

[ Attachment, skipping... ]

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Foreign key in pg_dump / psql

From
Tom Lane
Date:
Rod Taylor <rbt@zort.ca> writes:
> Is there any reason to create new constraint triggers?  Could the
> CONSTRAINT clause be removed after a couple of releases?

Not without breaking existing pg_dump files.  It will be many releases
before you will be able to sell that idea...

            regards, tom lane

Re: Foreign key in pg_dump / psql

From
Bruce Momjian
Date:
Tom has applied this.  Thanks.

---------------------------------------------------------------------------

Rod Taylor wrote:
> On Wed, 2002-08-14 at 10:05, Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Your patch has been added to the PostgreSQL unapplied patches list at:
> >
> > >> A couple of bits of the depend/constraint patch that were not applied.
> >
> > Again, this is code I still gotta review...
>
> The attached better handles constraint triggers which are not foreign
> keys.   It helps 7.2.
>
> Is there any reason to create new constraint triggers?  Could the
> CONSTRAINT clause be removed after a couple of releases?
>

[ Attachment, skipping... ]

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073