From 577e21b34f8629ce76651a6388298891f81be99a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 26 Oct 1999 03:12:39 +0000 Subject: Hello. The following patch extends the COMMENT ON functionality to the rest of the database objects beyond just tables, columns, and views. The grammer of the COMMENT ON statement now looks like: COMMENT ON [ [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ] | COLUMN . | AGGREGATE | FUNCTION (arg1, arg2, ...) | OPERATOR (leftoperand_typ rightoperand_typ) | TRIGGER ON relname> Mike Mascari (mascarim@yahoo.com) --- src/backend/commands/creatinh.c | 48 +---------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'src/backend/commands/creatinh.c') diff --git a/src/backend/commands/creatinh.c b/src/backend/commands/creatinh.c index 9463d55a6a1..f07586dac0a 100644 --- a/src/backend/commands/creatinh.c +++ b/src/backend/commands/creatinh.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.49 1999/10/15 01:49:39 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.50 1999/10/26 03:12:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -234,52 +234,6 @@ TruncateRelation(char *name) heap_truncate(name); } -/*------------------------------------------------------------------ - * CommentRelation -- - * Adds a comment to pg_description for the associated - * relation or relation attribute. - * - * Note: - * The comment is dropped on the relation or attribute if - * the comment is an empty string. - *------------------------------------------------------------------ - */ -void -CommentRelation(char *relname, char *attrname, char *comments) -{ - - Relation relation; - HeapTuple attrtuple; - Oid oid; - - /*** First ensure relname is valid ***/ - - relation = heap_openr(relname, AccessShareLock); - - /*** Now, if an attribute was specified, fetch its oid, else use relation's oid ***/ - - if (attrname != NULL) { - attrtuple = SearchSysCacheTuple(ATTNAME, ObjectIdGetDatum(relation->rd_id), - PointerGetDatum(attrname), 0, 0); - if (!HeapTupleIsValid(attrtuple)) { - elog(ERROR, "CommentRelation: attribute \"%s\" is not an attribute of relation \"%s\"", - attrname, relname); - } - oid = attrtuple->t_data->t_oid; - } else { - oid = RelationGetRelid(relation); - } - - /*** Call CreateComments() to create/drop the comments ***/ - - CreateComments(oid, comments); - - /*** Now, close the heap relation ***/ - - heap_close(relation, AccessShareLock); - -} - /* * MergeAttributes * Returns new schema given initial schema and supers. -- cgit v1.2.3