diff options
author | Bruce Momjian <bruce@momjian.us> | 2000-01-18 18:09:02 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2000-01-18 18:09:02 +0000 |
commit | 2eebcddeaa2a60fe836a8a10ac6c697bdd36bf8e (patch) | |
tree | 2699b6abf13f885f2c158ce4929e8a3f5d075a54 /src/backend/commands/comment.c | |
parent | 6c25ea23422a200b8b4394b9f95220999dbf9fa9 (diff) | |
download | postgresql-2eebcddeaa2a60fe836a8a10ac6c697bdd36bf8e.tar.gz postgresql-2eebcddeaa2a60fe836a8a10ac6c697bdd36bf8e.zip |
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
Diffstat (limited to 'src/backend/commands/comment.c')
-rw-r--r-- | src/backend/commands/comment.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |