RE: pg_dump / Unique constraints - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject RE: pg_dump / Unique constraints
Date
Msg-id NEBBIOAJBMEENKACLNPCIEINCCAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: pg_dump / Unique constraints  (Philip Warner <pjw@rhyme.com.au>)
Responses ALTER TABLE...ADD CONSTRAINT?
List pgsql-hackers
Just a quick question regarding the pg_dump program:

I notice that PRIMARY KEY constraints are currently dumped as:

PRIMARY KEY ("field")

Whereas (to be in line with all the other constraints), it should be dumped
as:

CONSTRAINT "name" PRIMARY KEY ("field")

Otherwise, some poor bugger who went to the trouble of giving his primary
keys custom names will lose them with a dump/restore???

Also, if they have defined a function or trigger that refers to that primary
key by name, won't it fail after a dump/restore? (If the name has changed?)

I'm just asking, because I'm still trying to find something small and
self-contained I can work on!

Chris



pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: RE: regressplans failures
Next
From: Don Baccus
Date:
Subject: OpenACS datamodel vs. current PG 7.1 sources