From f9a726aa883e1690f66bec535d85b34e1f9ed7e7 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 12 Feb 2006 03:22:21 +0000 Subject: 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 --- src/backend/commands/user.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/backend/commands/user.c') 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" @@ -940,6 +941,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, -- cgit v1.2.3