Skip to content

Commit a09ccc7

Browse files
committed
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>
1 parent ca64391 commit a09ccc7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.334 2003/06/25 03:56:31 momjian Exp $
15+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.335 2003/06/25 04:08:19 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -5347,8 +5347,7 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
53475347
if (actual_atts + j > 0)
53485348
appendPQExpBuffer(q, ",\n ");
53495349

5350-
if (name[0] != '$')
5351-
appendPQExpBuffer(q, "CONSTRAINT %s ",
5350+
appendPQExpBuffer(q, "CONSTRAINT %s ",
53525351
fmtId(name));
53535352
appendPQExpBuffer(q, "%s", expr);
53545353
}

0 commit comments

Comments
 (0)