summaryrefslogtreecommitdiff
path: root/src/include/catalog/pg_inherits_fn.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2010-02-01 19:28:56 +0000
committerRobert Haas <rhaas@postgresql.org>2010-02-01 19:28:56 +0000
commit63f9282f6e7a4afed8826437cea6e92d9e4b0869 (patch)
tree1c8c2e4c0d1fd5294e374a236585cbce210de4f6 /src/include/catalog/pg_inherits_fn.h
parent1526d4e38fc5a067ffa9779be34d4dbcfdf8ea5f (diff)
downloadpostgresql-63f9282f6e7a4afed8826437cea6e92d9e4b0869.tar.gz
Tighten integrity checks on ALTER TABLE ... ALTER COLUMN ... RENAME.
When a column is renamed, we recursively rename the same column in all descendent tables. But if one of those tables also inherits that column from a table outside the inheritance hierarchy rooted at the named table, we must throw an error. The previous coding correctly prohibited the rename when the parent had inherited the column from elsewhere, but overlooked the case where the parent was OK but a child table also inherited the same column from a second, unrelated parent. For now, not backpatched due to lack of complaints from the field. KaiGai Kohei, with further changes by me. Reviewed by Bernd Helme and Tom Lane.
Diffstat (limited to 'src/include/catalog/pg_inherits_fn.h')
-rw-r--r--src/include/catalog/pg_inherits_fn.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/catalog/pg_inherits_fn.h b/src/include/catalog/pg_inherits_fn.h
index 20dc534088..e22c497af5 100644
--- a/src/include/catalog/pg_inherits_fn.h
+++ b/src/include/catalog/pg_inherits_fn.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_inherits_fn.h,v 1.2 2010/01/02 16:58:01 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_inherits_fn.h,v 1.3 2010/02/01 19:28:56 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,7 +18,8 @@
#include "storage/lock.h"
extern List *find_inheritance_children(Oid parentrelId, LOCKMODE lockmode);
-extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode);
+extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode,
+ List **parents);
extern bool has_subclass(Oid relationId);
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);