diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-04-13 19:57:18 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-04-13 19:57:18 +0000 |
commit | 7603c42edfdef71bd7d4a2acaaf5304e3a5f7487 (patch) | |
tree | c1deb57963edfb7865ac95e309e4678d42556352 /src | |
parent | b73859db8c94ca061a31aae2fae21a12c87c085d (diff) | |
download | postgresql-7603c42edfdef71bd7d4a2acaaf5304e3a5f7487.tar.gz postgresql-7603c42edfdef71bd7d4a2acaaf5304e3a5f7487.zip |
Rod's patch does what it is supposed to do, but it also includes
some old code to add PK constraints to CREATE TABLE. That stuff
had been removed as part of my original patch for pg_dump a
little while ago.
The attached patch fixes this by removing (again :-) ) the
code in dumpTables() to perform PK creation during CREATE
TABLE. I briefly tested it locally and it fixes both of
Tom's test cases.
Please apply.
Cheers,
Neil
--
Neil Conway <neilconway@rogers.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 0e54fd80d78..f1cf4854f5e 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -22,7 +22,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.247 2002/04/11 20:00:06 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.248 2002/04/13 19:57:18 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -4418,36 +4418,6 @@ dumpTables(Archive *fout, TableInfo *tblinfo, int numTables, tblinfo[i].check_expr[k]); } - /* Primary Key */ - if (tblinfo[i].pkIndexOid != NULL) - { - PQExpBuffer consDef; - - /* Find the corresponding index */ - for (k = 0; k < numIndexes; k++) - { - if (strcmp(indinfo[k].indexreloid, - tblinfo[i].pkIndexOid) == 0) - break; - } - - if (k >= numIndexes) - { - write_msg(NULL, "dumpTables(): failed sanity check, could not find index (%s) for primary key constraint\n", - tblinfo[i].pkIndexOid); - exit_nicely(); - } - - consDef = getPKconstraint(&tblinfo[i], &indinfo[k]); - - if ((actual_atts + tblinfo[i].ncheck) > 0) - appendPQExpBuffer(q, ",\n\t"); - - appendPQExpBuffer(q, "%s", consDef->data); - - destroyPQExpBuffer(consDef); - } - /* * Primary Key: In versions of PostgreSQL prior to 7.2, we * needed to include the primary key in the table definition. |