Foreign key in pg_dump / psql

Started by Rod Tayloralmost 24 years ago8 messagespatches
Jump to latest
#1Rod Taylor
rbt@rbt.ca

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).

Attachments:

fkey.patchtext/x-patch; charset=ISO-8859-1; name=fkey.patchDownload+374-25
#2Bruce Momjian
bruce@momjian.us
In reply to: Rod Taylor (#1)
Re: Foreign key in pg_dump / psql

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
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: Foreign key in pg_dump / psql

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: Foreign key in pg_dump / psql

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
#5Rod Taylor
rbt@rbt.ca
In reply to: Tom Lane (#3)
Re: Foreign key in pg_dump / psql

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?

Attachments:

fkey.patchtext/plain; charset=ISO-8859-1; name=fkey.patchDownload+401-38
#6Bruce Momjian
bruce@momjian.us
In reply to: Rod Taylor (#5)
Re: Foreign key in pg_dump / psql

[ 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
#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Rod Taylor (#5)
Re: Foreign key in pg_dump / psql

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

#8Bruce Momjian
bruce@momjian.us
In reply to: Rod Taylor (#5)
Re: Foreign key in pg_dump / psql

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