Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2eebcdd

Browse files
committed
Bruce,
Attached is a patch which patches cleanly against the Sunday afternoonsnapshot. It modifies pg_dump to dump COMMENT ON statements foruser-definable descriptions. In addition, it also modifies comment.c sothat the operator behavior is as Peter E. would like: a comment on anoperator is applied to the underlying function.Thanks,Mike Mascari
1 parent6c25ea2 commit2eebcdd

File tree

4 files changed

+229
-9
lines changed

4 files changed

+229
-9
lines changed

‎src/backend/commands/comment.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include"catalog/pg_aggregate.h"
2020
#include"catalog/pg_database.h"
2121
#include"catalog/pg_description.h"
22+
#include"catalog/pg_operator.h"
2223
#include"catalog/pg_proc.h"
2324
#include"catalog/pg_rewrite.h"
2425
#include"catalog/pg_shadow.h"
@@ -658,6 +659,7 @@ void CommentProc(char *function, List *arguments, char *comment)
658659

659660
voidCommentOperator(char*opername,List*arguments,char*comment) {
660661

662+
Form_pg_operatordata;
661663
HeapTupleoptuple;
662664
Oidoid,leftoid=InvalidOid,rightoid=InvalidOid;
663665
booldefined;
@@ -719,6 +721,14 @@ void CommentOperator(char *opername, List *arguments, char *comment) {
719721
}
720722
#endif
721723

724+
/*** Get the procedure associated with the operator ***/
725+
726+
data= (Form_pg_operator)GETSTRUCT(optuple);
727+
oid=regproctooid(data->oprcode);
728+
if (oid==InvalidOid) {
729+
elog(ERROR,"operator '%s' does not have an underlying function",opername);
730+
}
731+
722732
/*** Call CreateComments() to create/drop the comments ***/
723733

724734
CreateComments(oid,comment);

‎src/bin/pg_dump/common.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.38 2000/01/1807:29:58 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.39 2000/01/1818:09:02 momjian Exp $
1111
*
1212
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
1313
*
@@ -289,6 +289,14 @@ dumpSchema(FILE *fout,
289289
g_comment_start,g_comment_end);
290290
flagInhAttrs(tblinfo,numTables,inhinfo,numInherits);
291291

292+
if (!tablename&&fout)
293+
{
294+
if (g_verbose)
295+
fprintf(stderr,"%s dumping out database comment %s\n",
296+
g_comment_start,g_comment_end);
297+
dumpDBComment(fout);
298+
}
299+
292300
if (!tablename&&fout)
293301
{
294302
if (g_verbose)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp