From 2eebcddeaa2a60fe836a8a10ac6c697bdd36bf8e Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 18 Jan 2000 18:09:02 +0000 Subject: Bruce, Attached is a patch which patches cleanly against the Sunday afternoon snapshot. It modifies pg_dump to dump COMMENT ON statements for user-definable descriptions. In addition, it also modifies comment.c so that the operator behavior is as Peter E. would like: a comment on an operator is applied to the underlying function. Thanks, Mike Mascari --- src/backend/commands/comment.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/backend/commands/comment.c') diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index 9ebf207199c..dc8247691ab 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -19,6 +19,7 @@ #include "catalog/pg_aggregate.h" #include "catalog/pg_database.h" #include "catalog/pg_description.h" +#include "catalog/pg_operator.h" #include "catalog/pg_proc.h" #include "catalog/pg_rewrite.h" #include "catalog/pg_shadow.h" @@ -658,6 +659,7 @@ void CommentProc(char *function, List *arguments, char *comment) void CommentOperator(char *opername, List *arguments, char *comment) { + Form_pg_operator data; HeapTuple optuple; Oid oid, leftoid = InvalidOid, rightoid = InvalidOid; bool defined; @@ -719,6 +721,14 @@ void CommentOperator(char *opername, List *arguments, char *comment) { } #endif + /*** Get the procedure associated with the operator ***/ + + data = (Form_pg_operator) GETSTRUCT(optuple); + oid = regproctooid(data->oprcode); + if (oid == InvalidOid) { + elog(ERROR, "operator '%s' does not have an underlying function", opername); + } + /*** Call CreateComments() to create/drop the comments ***/ CreateComments(oid, comment); -- cgit v1.2.3