Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7603c42

Browse files
committed
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 stuffhad been removed as part of my original patch for pg_dump alittle while ago.The attached patch fixes this by removing (again :-) ) thecode in dumpTables() to perform PK creation during CREATETABLE. I briefly tested it locally and it fixes both ofTom's test cases.Please apply.Cheers,Neil--Neil Conway <neilconway@rogers.com>
1 parentb73859d commit7603c42

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* IDENTIFICATION
25-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.247 2002/04/11 20:00:06 tgl Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.248 2002/04/13 19:57:18 momjian Exp $
2626
*
2727
*-------------------------------------------------------------------------
2828
*/
@@ -4418,36 +4418,6 @@ dumpTables(Archive *fout, TableInfo *tblinfo, int numTables,
44184418
tblinfo[i].check_expr[k]);
44194419
}
44204420

4421-
/* Primary Key */
4422-
if (tblinfo[i].pkIndexOid!=NULL)
4423-
{
4424-
PQExpBufferconsDef;
4425-
4426-
/* Find the corresponding index */
4427-
for (k=0;k<numIndexes;k++)
4428-
{
4429-
if (strcmp(indinfo[k].indexreloid,
4430-
tblinfo[i].pkIndexOid)==0)
4431-
break;
4432-
}
4433-
4434-
if (k >=numIndexes)
4435-
{
4436-
write_msg(NULL,"dumpTables(): failed sanity check, could not find index (%s) for primary key constraint\n",
4437-
tblinfo[i].pkIndexOid);
4438-
exit_nicely();
4439-
}
4440-
4441-
consDef=getPKconstraint(&tblinfo[i],&indinfo[k]);
4442-
4443-
if ((actual_atts+tblinfo[i].ncheck)>0)
4444-
appendPQExpBuffer(q,",\n\t");
4445-
4446-
appendPQExpBuffer(q,"%s",consDef->data);
4447-
4448-
destroyPQExpBuffer(consDef);
4449-
}
4450-
44514421
/*
44524422
* Primary Key: In versions of PostgreSQL prior to 7.2, we
44534423
* needed to include the primary key in the table definition.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp