summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2005-11-21 12:49:33 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2005-11-21 12:49:33 +0000
commitcec3b0a9e63fd94b05dac894cca8bfa51358afec (patch)
tree464377c39a1b3f42b4d2ab82a261e9a603fa1220 /src/include/nodes
parentc52795d18a698d25b9cd7cd1ca9318a42b08fdb9 (diff)
downloadpostgresql-cec3b0a9e63fd94b05dac894cca8bfa51358afec.tar.gz
Implement DROP OWNED and REASSIGN OWNED. These new commands facilitate the
process of dropping roles by dropping objects owned by them and privileges granted to them, or giving the owned objects to someone else, through the use of the data stored in the new pg_shdepend catalog. Some refactoring of the GRANT/REVOKE code was needed, as well as ALTER OWNER code. Further cleanup of code duplication in the GRANT code seems necessary. Implemented by me after an idea from Tom Lane, who also provided various kind of implementation advice. Regression tests pass. Some tests for the new functionality are also added, as well as rudimentary documentation.
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/nodes.h4
-rw-r--r--src/include/nodes/parsenodes.h22
2 files changed, 24 insertions, 2 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 327e4301ff..919753ea92 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.176 2005/10/15 02:49:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.177 2005/11/21 12:49:32 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -286,6 +286,8 @@ typedef enum NodeTag
T_DropTableSpaceStmt,
T_AlterObjectSchemaStmt,
T_AlterOwnerStmt,
+ T_DropOwnedStmt,
+ T_ReassignOwnedStmt,
T_A_Expr = 800,
T_ColumnRef,
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 8baed3e449..a482abfb35 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.293 2005/11/19 17:39:45 adunstan Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.294 2005/11/21 12:49:32 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1875,4 +1875,24 @@ typedef struct DeallocateStmt
char *name; /* The name of the plan to remove */
} DeallocateStmt;
+/*
+ * DROP OWNED statement
+ */
+typedef struct DropOwnedStmt
+{
+ NodeTag type;
+ List *roles;
+ DropBehavior behavior;
+} DropOwnedStmt;
+
+/*
+ * REASSIGN OWNED statement
+ */
+typedef struct ReassignOwnedStmt
+{
+ NodeTag type;
+ List *roles;
+ char *newrole;
+} ReassignOwnedStmt;
+
#endif /* PARSENODES_H */