agora inbox for pgsql-hackers@postgresql.orghelp / color / mirror / Atom feed
[PATCH] Add COMMENT support for publications and subscriptions 455+ messages / 1 participants [nested] [flat]
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
* [PATCH] Add COMMENT support for publications and subscriptions @ 2017-03-24 04:15 Peter Eisentraut <peter_e@gmx.net> 0 siblings, 0 replies; 455+ messages in thread From: Peter Eisentraut @ 2017-03-24 04:15 UTC (permalink / raw) --- doc/src/sgml/ref/comment.sgml | 2 ++ src/backend/parser/gram.y | 16 ++++++++++++++++ src/test/regress/expected/publication.out | 7 +++++++ src/test/regress/expected/subscription.out | 7 +++++++ src/test/regress/sql/publication.sql | 3 +++ src/test/regress/sql/subscription.sql | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 7483c8c03f..21d8894dc3 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -46,11 +46,13 @@ OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> | POLICY <replaceable class="PARAMETER">policy_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> | + PUBLICATION <replaceable class="PARAMETER">object_name</replaceable> | ROLE <replaceable class="PARAMETER">object_name</replaceable> | RULE <replaceable class="PARAMETER">rule_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> | SCHEMA <replaceable class="PARAMETER">object_name</replaceable> | SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> | SERVER <replaceable class="PARAMETER">object_name</replaceable> | + SUBSCRIPTION <replaceable class="PARAMETER">object_name</replaceable> | TABLE <replaceable class="PARAMETER">object_name</replaceable> | TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> | TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> | diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 82844a0399..7b812c02ec 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -6225,6 +6225,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON PUBLICATION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_PUBLICATION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); @@ -6233,6 +6241,14 @@ CommentStmt: n->comment = $8; $$ = (Node *) n; } + | COMMENT ON SUBSCRIPTION name IS comment_text + { + CommentStmt *n = makeNode(CommentStmt); + n->objtype = OBJECT_SUBSCRIPTION; + n->object = (Node *) makeString($4); + n->comment = $6; + $$ = (Node *) n; + } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 5a7c0edf7d..0964718a60 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,6 +6,13 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + obj_description +------------------ + test publication +(1 row) + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); \dRp diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 0912bef657..f8d12797e2 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -24,6 +24,13 @@ ERROR: invalid connection string syntax: missing "=" after "testconn" in connec CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + obj_description +------------------- + test subscription +(1 row) + \dRs+ List of subscriptions Name | Owner | Enabled | Publication | Conninfo diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql index cff9931a77..85530bec0e 100644 --- a/src/test/regress/sql/publication.sql +++ b/src/test/regress/sql/publication.sql @@ -8,6 +8,9 @@ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; CREATE PUBLICATION testpub_default; +COMMENT ON PUBLICATION testpub_default IS 'test publication'; +SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; + CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update); ALTER PUBLICATION testpub_default WITH (nopublish insert, nopublish delete); diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index c1199ee629..e9d1eab8f8 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -21,6 +21,10 @@ CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (NOCONNECT); +COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; + + \dRs+ ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 NOREFRESH; -- 2.12.1 --------------49B9236F6851BBF2B277E696 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------49B9236F6851BBF2B277E696-- ^ permalink raw reply [nested|flat] 455+ messages in thread
end of thread, other threads:[~2017-03-24 04:15 UTC | newest] Thread overview: 455+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net> 2017-03-24 04:15 [PATCH] Add COMMENT support for publications and subscriptions Peter Eisentraut <peter_e@gmx.net>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox