summaryrefslogtreecommitdiff
path: root/src/backend/commands/user.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-02-12 03:22:21 +0000
committerBruce Momjian <bruce@momjian.us>2006-02-12 03:22:21 +0000
commitf9a726aa883e1690f66bec535d85b34e1f9ed7e7 (patch)
tree764d3d849a2614ea5edcd05eaa36496a79f06c87 /src/backend/commands/user.c
parent95dbf9c02f9a37fc171e0b94b37f9f903abc3942 (diff)
I've created a new shared catalog table pg_shdescription to store
comments on cluster global objects like databases, tablespaces, and roles. It touches a lot of places, but not much in the way of big changes. The only design decision I made was to duplicate the query and manipulation functions rather than to try and have them handle both shared and local comments. I believe this is simpler for the code and not an issue for callers because they know what type of object they are dealing with. This has resulted in a shobj_description function analagous to obj_description and backend functions [Create/Delete]SharedComments mirroring the existing [Create/Delete]Comments functions. pg_shdescription.h goes into src/include/catalog/ Kris Jurka
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r--src/backend/commands/user.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index b3aa2ed8295..24a5abdecc1 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.168 2006/02/04 19:06:46 adunstan Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.169 2006/02/12 03:22:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,6 +18,7 @@
#include "catalog/indexing.h"
#include "catalog/pg_auth_members.h"
#include "catalog/pg_authid.h"
+#include "commands/comment.h"
#include "commands/user.h"
#include "libpq/crypt.h"
#include "miscadmin.h"
@@ -941,6 +942,11 @@ DropRole(DropRoleStmt *stmt)
systable_endscan(sscan);
/*
+ * Remove any comments on this role.
+ */
+ DeleteSharedComments(roleid, AuthIdRelationId);
+
+ /*
* Advance command counter so that later iterations of this loop will
* see the changes already made. This is essential if, for example,
* we are trying to drop both a role and one of its direct members ---