@@ -1182,10 +1182,9 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
1182
1182
*/
1183
1183
if (sub -> twophasestate == LOGICALREP_TWOPHASE_STATE_ENABLED && opts .copy_data )
1184
1184
ereport (ERROR ,
1185
- (errcode (ERRCODE_SYNTAX_ERROR ),
1185
+ (errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
1186
1186
errmsg ("ALTER SUBSCRIPTION with refresh and copy_data is not allowed when two_phase is enabled" ),
1187
- errhint ("Use ALTER SUBSCRIPTION ... SET PUBLICATION with refresh = false, or with copy_data = false"
1188
- ", or use DROP/CREATE SUBSCRIPTION." )));
1187
+ errhint ("Use ALTER SUBSCRIPTION ... SET PUBLICATION with refresh = false, or with copy_data = false, or use DROP/CREATE SUBSCRIPTION." )));
1189
1188
1190
1189
PreventInTransactionBlock (isTopLevel , "ALTER SUBSCRIPTION with refresh" );
1191
1190
@@ -1226,18 +1225,25 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
1226
1225
ereport (ERROR ,
1227
1226
(errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
1228
1227
errmsg ("ALTER SUBSCRIPTION with refresh is not allowed for disabled subscriptions" ),
1229
- errhint ("Use ALTER SUBSCRIPTION ... SET PUBLICATION ... WITH (refresh = false)." )));
1228
+ /* translator: %s is an SQL ALTER command */
1229
+ errhint ("Use %s instead." ,
1230
+ isadd ?
1231
+ "ALTER SUBSCRIPTION ... ADD PUBLICATION ... WITH (refresh = false)" :
1232
+ "ALTER SUBSCRIPTION ... DROP PUBLICATION ... WITH (refresh = false)" )));
1230
1233
1231
1234
/*
1232
1235
* See ALTER_SUBSCRIPTION_REFRESH for details why this is
1233
1236
* not allowed.
1234
1237
*/
1235
1238
if (sub -> twophasestate == LOGICALREP_TWOPHASE_STATE_ENABLED && opts .copy_data )
1236
1239
ereport (ERROR ,
1237
- (errcode (ERRCODE_SYNTAX_ERROR ),
1240
+ (errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
1238
1241
errmsg ("ALTER SUBSCRIPTION with refresh and copy_data is not allowed when two_phase is enabled" ),
1239
- errhint ("Use ALTER SUBSCRIPTION ... SET PUBLICATION with refresh = false, or with copy_data = false"
1240
- ", or use DROP/CREATE SUBSCRIPTION." )));
1242
+ /* translator: %s is an SQL ALTER command */
1243
+ errhint ("Use %s with refresh = false, or with copy_data = false, or use DROP/CREATE SUBSCRIPTION." ,
1244
+ isadd ?
1245
+ "ALTER SUBSCRIPTION ... ADD PUBLICATION" :
1246
+ "ALTER SUBSCRIPTION ... DROP PUBLICATION" )));
1241
1247
1242
1248
PreventInTransactionBlock (isTopLevel , "ALTER SUBSCRIPTION with refresh" );
1243
1249
@@ -1282,8 +1288,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
1282
1288
ereport (ERROR ,
1283
1289
(errcode (ERRCODE_SYNTAX_ERROR ),
1284
1290
errmsg ("ALTER SUBSCRIPTION ... REFRESH with copy_data is not allowed when two_phase is enabled" ),
1285
- errhint ("Use ALTER SUBSCRIPTION ... REFRESH with copy_data = false"
1286
- ", or use DROP/CREATE SUBSCRIPTION." )));
1291
+ errhint ("Use ALTER SUBSCRIPTION ... REFRESH with copy_data = false, or use DROP/CREATE SUBSCRIPTION." )));
1287
1292
1288
1293
PreventInTransactionBlock (isTopLevel , "ALTER SUBSCRIPTION ... REFRESH" );
1289
1294
@@ -2011,8 +2016,8 @@ ReportSlotConnectionError(List *rstates, Oid subid, char *slotname, char *err)
2011
2016
2012
2017
ereport (ERROR ,
2013
2018
(errcode (ERRCODE_CONNECTION_FAILURE ),
2014
- errmsg ("could not connect to publisher when attempting to "
2015
- "drop replication slot \"%s\": %s" , slotname , err ),
2019
+ errmsg ("could not connect to publisher when attempting to drop replication slot \"%s\": %s" ,
2020
+ slotname , err ),
2016
2021
/* translator: %s is an SQL ALTER command */
2017
2022
errhint ("Use %s to disassociate the subscription from the slot." ,
2018
2023
"ALTER SUBSCRIPTION ... SET (slot_name = NONE)" )));
0 commit comments