aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2006-08-20 21:56:16 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2006-08-20 21:56:16 +0000
commitdf18c51f2955f6dc30027c91546a607abd699c40 (patch)
tree2e51ac170971b7f17189a82ba4b145373930c635 /src/include
parent4e23d6e07ddb398a1654e60ec6fb908065b9e252 (diff)
downloadpostgresql-df18c51f2955f6dc30027c91546a607abd699c40.tar.gz
postgresql-df18c51f2955f6dc30027c91546a607abd699c40.zip
Fix DROP OWNED BY to correctly consider the implicitly-deleted objects list for
each object to be deleted, instead of the previous hack that just skipped INTERNAL dependencies, which didn't really work. Per report from Tom Lane. To do this, introduce a new performMultipleDeletions entry point in dependency.c to delete multiple objects at once. The dependency code then has the responsability of tracking INTERNAL and AUTO dependencies as needed. Along the way, change ObjectAddresses so that we can allocate an ObjectAddress list from outside dependency.c and not have to export the internal representation.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/dependency.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h
index fbfe40e472f..04dc3ac7f3a 100644
--- a/src/include/catalog/dependency.h
+++ b/src/include/catalog/dependency.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.25 2006/06/27 18:35:05 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.26 2006/08/20 21:56:16 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -112,6 +112,8 @@ typedef struct ObjectAddress
int32 objectSubId; /* Subitem within the object (column of table) */
} ObjectAddress;
+/* expansible list of ObjectAddresses */
+typedef struct ObjectAddresses ObjectAddresses;
/*
* This enum covers all system catalogs whose OIDs can appear in
@@ -144,6 +146,9 @@ typedef enum ObjectClass
extern void performDeletion(const ObjectAddress *object,
DropBehavior behavior);
+extern void performMultipleDeletions(const ObjectAddresses *objects,
+ DropBehavior behavior);
+
extern void deleteWhatDependsOn(const ObjectAddress *object,
bool showNotices);
@@ -160,6 +165,16 @@ extern ObjectClass getObjectClass(const ObjectAddress *object);
extern char *getObjectDescription(const ObjectAddress *object);
+extern ObjectAddresses *new_object_addresses(void);
+
+extern void add_exact_object_address(const ObjectAddress *object,
+ ObjectAddresses *addrs);
+
+extern bool object_address_present(const ObjectAddress *object,
+ ObjectAddresses *addrs);
+
+extern void free_object_addresses(ObjectAddresses *addrs);
+
/* in pg_depend.c */
extern void recordDependencyOn(const ObjectAddress *depender,