Notice message of ALTER SUBSCRIPTION ... RERESH PUBLICATIION

Started by Yugo Nagataover 8 years ago3 messages
#1Yugo Nagata
nagata@sraoss.co.jp
1 attachment(s)

Hi,

When we run ALTER SUBSCRIPTION ... REFRESH PUBLICATION and there is
an unkown table at local, it says;

NOTICE: added subscription for table public.tbl

I feel this a bit misleading because it says a subscription is added
but actually new subscription object is not created. Of cause, I can
understand the intention this message says, but I feel that
it is better to use other expression. For example, how about saying

NOTICE: table public.tbl is added to subscription sub1

as proposed in the attached patch. This also fixes the message
when a table is removed from a subscription.

Regards,

--
Yugo Nagata <nagata@sraoss.co.jp>

Attachments:

alter_subscription_refresh.patchtext/x-diff; name=alter_subscription_refresh.patchDownload
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index 6dc3f6e..5a7e6d5 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -573,9 +573,10 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
 									copy_data ? SUBREL_STATE_INIT : SUBREL_STATE_READY,
 									InvalidXLogRecPtr, false);
 			ereport(NOTICE,
-					(errmsg("added subscription for table %s.%s",
+					(errmsg("table %s.%s is added to subscription %s",
 							quote_identifier(rv->schemaname),
-							quote_identifier(rv->relname))));
+							quote_identifier(rv->relname),
+							quote_identifier(sub->name))));
 		}
 	}
 
@@ -601,9 +602,10 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
 
 			namespace = get_namespace_name(get_rel_namespace(relid));
 			ereport(NOTICE,
-					(errmsg("removed subscription for table %s.%s",
+					(errmsg("table %s.%s is removed from subscription %s",
 							quote_identifier(namespace),
-							quote_identifier(get_rel_name(relid)))));
+							quote_identifier(get_rel_name(relid)),
+							quote_identifier(sub->name))));
 		}
 	}
 }
#2Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Yugo Nagata (#1)
Re: Notice message of ALTER SUBSCRIPTION ... RERESH PUBLICATIION

On 7/27/17 20:51, Yugo Nagata wrote:

When we run ALTER SUBSCRIPTION ... REFRESH PUBLICATION and there is
an unkown table at local, it says;

NOTICE: added subscription for table public.tbl

I feel this a bit misleading because it says a subscription is added
but actually new subscription object is not created. Of cause, I can
understand the intention this message says, but I feel that
it is better to use other expression. For example, how about saying

NOTICE: table public.tbl is added to subscription sub1

as proposed in the attached patch. This also fixes the message
when a table is removed from a subscription.

Fixed, thanks. (Note that per another discussion, these are now DEBUG
messages.)

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Yugo Nagata
nagata@sraoss.co.jp
In reply to: Peter Eisentraut (#2)
Re: Notice message of ALTER SUBSCRIPTION ... RERESH PUBLICATIION

On Mon, 7 Aug 2017 09:46:56 -0400
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:

On 7/27/17 20:51, Yugo Nagata wrote:

When we run ALTER SUBSCRIPTION ... REFRESH PUBLICATION and there is
an unkown table at local, it says;

NOTICE: added subscription for table public.tbl

I feel this a bit misleading because it says a subscription is added
but actually new subscription object is not created. Of cause, I can
understand the intention this message says, but I feel that
it is better to use other expression. For example, how about saying

NOTICE: table public.tbl is added to subscription sub1

as proposed in the attached patch. This also fixes the message
when a table is removed from a subscription.

Fixed, thanks. (Note that per another discussion, these are now DEBUG
messages.)

Thanks, too.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Yugo Nagata <nagata@sraoss.co.jp>

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers