From 0adfa2c39d567394f423c69bfaf467d0d00ee3df Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 25 Jun 2004 21:55:59 +0000 Subject: Support renaming of tablespaces, and changing the owners of aggregates, conversions, functions, operators, operator classes, schemas, types, and tablespaces. Fold the existing implementations of alter domain owner and alter database owner in with these. Christopher Kings-Lynne --- src/include/nodes/nodes.h | 4 ++-- src/include/nodes/parsenodes.h | 29 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 13 deletions(-) (limited to 'src/include/nodes') diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 531b7e6c654..258bdc7b61e 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.158 2004/06/18 06:14:11 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.159 2004/06/25 21:55:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -270,7 +270,7 @@ typedef enum NodeTag T_DeclareCursorStmt, T_CreateTableSpaceStmt, T_DropTableSpaceStmt, - T_AlterDbOwnerStmt, + T_AlterOwnerStmt, T_A_Expr = 800, T_ColumnRef, diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 4c24fe9e27b..22d18ef4f70 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.259 2004/06/18 06:14:11 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.260 2004/06/25 21:55:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -838,12 +838,10 @@ typedef struct AlterDomainStmt * O = alter column set not null * C = add constraint * X = drop constraint - * U = change owner *------------ */ List *typename; /* domain to work on */ - char *name; /* column or constraint name to act on, or - * new owner */ + char *name; /* column or constraint name to act on */ Node *def; /* definition of default or constraint */ DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ } AlterDomainStmt; @@ -1445,6 +1443,22 @@ typedef struct RenameStmt ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */ } RenameStmt; +/* ---------------------- + * Alter Object Owner Statement + * ---------------------- + */ +typedef struct AlterOwnerStmt +{ + NodeTag type; + RangeVar *relation; /* in case it's a table */ + List *object; /* in case it's some other object */ + List *objarg; /* argument types, if applicable */ + char *addname; /* additional name if needed */ + char *newowner; /* the new owner */ + ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */ +} AlterOwnerStmt; + + /* ---------------------- * Create Rule Statement * ---------------------- @@ -1560,13 +1574,6 @@ typedef struct CreatedbStmt * Alter Database * ---------------------- */ -typedef struct AlterDbOwnerStmt -{ - NodeTag type; - char *dbname; - char *uname; -} AlterDbOwnerStmt; - typedef struct AlterDatabaseSetStmt { NodeTag type; -- cgit v1.2.3