diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-10-26 03:12:39 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-10-26 03:12:39 +0000 |
commit | 577e21b34f8629ce76651a6388298891f81be99a (patch) | |
tree | f03a048bca5a17f70e4fa4337629d2ca52af6b34 /src/backend/commands/creatinh.c | |
parent | 51f62d505e2aba66bf7870c7bd005cd32e7d0953 (diff) | |
download | postgresql-577e21b34f8629ce76651a6388298891f81be99a.tar.gz postgresql-577e21b34f8629ce76651a6388298891f81be99a.zip |
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 ] <objname>
|
COLUMN <relation>.<attribute> |
AGGREGATE <aggname> <aggtype> |
FUNCTION <funcname> (arg1, arg2, ...) |
OPERATOR <op> (leftoperand_typ rightoperand_typ) |
TRIGGER <triggername> ON relname>
Mike Mascari
(mascarim@yahoo.com)
Diffstat (limited to 'src/backend/commands/creatinh.c')
-rw-r--r-- | src/backend/commands/creatinh.c | 48 |
1 files changed, 1 insertions, 47 deletions
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. |