diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-06-25 04:08:19 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-06-25 04:08:19 +0000 |
commit | a09ccc70dd78b33271b06a6c250f7578aa4e16a1 (patch) | |
tree | c525805c35c68c7124d936a713f32d7bde71fe48 /src | |
parent | ca64391d6ca5a8aef6876961f2a8517e014b472d (diff) |
If they're not, the below causes problems, as the foreign key is added
after the CHECK. Cluster depends on the index name, so I thought it
wise to ensure all names are available, rather than leaving off the
CONSTRAINT "$n" portion for internally named constraints.
CREATE TABLE jkey (col integer primary key);
CREATE TABLE j (col integer REFERENCES jkey);
ALTER TABLE j ADD CHECK(col > 5);
This is a problem in 7.3 series as well as -Tip.
Rod Taylor <rbt@rbt.ca>
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 4879620f12c..c7e30d7c71b 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -12,7 +12,7 @@ * by PostgreSQL * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.334 2003/06/25 03:56:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.335 2003/06/25 04:08:19 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -5347,8 +5347,7 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo) if (actual_atts + j > 0) appendPQExpBuffer(q, ",\n "); - if (name[0] != '$') - appendPQExpBuffer(q, "CONSTRAINT %s ", + appendPQExpBuffer(q, "CONSTRAINT %s ", fmtId(name)); appendPQExpBuffer(q, "%s", expr); } |