diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-12-14 03:35:28 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-12-14 03:35:28 +0000 |
| commit | 7431796b46e53da3d548e82928c1a18c08e936c9 (patch) | |
| tree | ed8a031aee8859559ce8b798a843200c3598c2fc /src/backend/commands | |
| parent | 549a8ba59aa2d14e01d90a2d01fece4f4798096f (diff) | |
| download | postgresql-7431796b46e53da3d548e82928c1a18c08e936c9.tar.gz | |
fix_parsetree_attnums was not nearly smart enough about walking parse
trees. Also rewrite find_all_inheritors() in a more intelligible style.
Diffstat (limited to 'src/backend/commands')
| -rw-r--r-- | src/backend/commands/command.c | 8 | ||||
| -rw-r--r-- | src/backend/commands/rename.c | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index c26228677e..ddf89b8d7d 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.59 1999/12/10 03:55:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.60 1999/12/14 03:35:20 tgl Exp $ * * NOTES * The PortalExecutorHeapMemory crap needs to be eliminated @@ -340,12 +340,11 @@ PerformAddAttribute(char *relationName, { if (inherits) { - Oid childrelid; List *child, *children; /* this routine is actually in the planner */ - children = find_all_inheritors(lconsi(myrelid, NIL), NIL); + children = find_all_inheritors(myrelid); /* * find_all_inheritors does the recursive search of the @@ -354,7 +353,8 @@ PerformAddAttribute(char *relationName, */ foreach(child, children) { - childrelid = lfirsti(child); + Oid childrelid = lfirsti(child); + if (childrelid == myrelid) continue; rel = heap_open(childrelid, AccessExclusiveLock); diff --git a/src/backend/commands/rename.c b/src/backend/commands/rename.c index cf2c1a1bd0..b3f1e53989 100644 --- a/src/backend/commands/rename.c +++ b/src/backend/commands/rename.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.37 1999/11/25 00:15:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.38 1999/12/14 03:35:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -97,7 +97,7 @@ renameatt(char *relname, *children; /* this routine is actually in the planner */ - children = find_all_inheritors(lconsi(relid, NIL), NIL); + children = find_all_inheritors(relid); /* * find_all_inheritors does the recursive search of the @@ -106,10 +106,9 @@ renameatt(char *relname, */ foreach(child, children) { - Oid childrelid; + Oid childrelid = lfirsti(child); char childname[NAMEDATALEN]; - childrelid = lfirsti(child); if (childrelid == relid) continue; reltup = SearchSysCacheTuple(RELOID, |
