aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-09-24 22:54:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-09-24 22:54:44 +0000
commit303e089df56251ad09e65f92df000e4ace6d82c1 (patch)
tree09a4bee24294652a8bdf35ba4ad62f17593ebb85 /src/backend/commands/tablecmds.c
parent5d9c6b18d30daa35e59c89f33c685e0133da0bf4 (diff)
downloadpostgresql-303e089df56251ad09e65f92df000e4ace6d82c1.tar.gz
postgresql-303e089df56251ad09e65f92df000e4ace6d82c1.zip
Clean up possibly-uninitialized-variable warnings reported by gcc 4.x.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 7bf1d297a7a..b3d0e017f15 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.170 2005/08/26 03:07:16 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.171 2005/09/24 22:54:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4109,6 +4109,8 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
* look up each one in the pg_index syscache until we find one marked
* primary key (hopefully there isn't more than one such).
*/
+ *indexOid = InvalidOid;
+
indexoidlist = RelationGetIndexList(pkrel);
foreach(indexoidscan, indexoidlist)
@@ -4127,7 +4129,6 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
break;
}
ReleaseSysCache(indexTuple);
- indexStruct = NULL;
}
list_free(indexoidlist);
@@ -4135,7 +4136,7 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
/*
* Check that we found it
*/
- if (indexStruct == NULL)
+ if (!OidIsValid(*indexOid))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("there is no primary key for referenced table \"%s\"",