@@ -1135,10 +1135,9 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
1135
1135
*/
1136
1136
if (sub -> twophasestate == LOGICALREP_TWOPHASE_STATE_ENABLED && opts .copy_data )
1137
1137
ereport (ERROR ,
1138
- (errcode (ERRCODE_SYNTAX_ERROR ),
1138
+ (errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
1139
1139
errmsg ("ALTER SUBSCRIPTION with refresh and copy_data is not allowed when two_phase is enabled" ),
1140
- errhint ("Use ALTER SUBSCRIPTION ...SET PUBLICATION with refresh = false, or with copy_data = false"
1141
- ", or use DROP/CREATE SUBSCRIPTION." )));
1140
+ errhint ("Use ALTER SUBSCRIPTION ... SET PUBLICATION with refresh = false, or with copy_data = false, or use DROP/CREATE SUBSCRIPTION." )));
1142
1141
1143
1142
PreventInTransactionBlock (isTopLevel , "ALTER SUBSCRIPTION with refresh" );
1144
1143
@@ -1179,18 +1178,25 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
1179
1178
ereport (ERROR ,
1180
1179
(errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
1181
1180
errmsg ("ALTER SUBSCRIPTION with refresh is not allowed for disabled subscriptions" ),
1182
- errhint ("Use ALTER SUBSCRIPTION ... SET PUBLICATION ... WITH (refresh = false)." )));
1181
+ /* translator: %s is an SQL ALTER command */
1182
+ errhint ("Use %s instead." ,
1183
+ isadd ?
1184
+ "ALTER SUBSCRIPTION ... ADD PUBLICATION ... WITH (refresh = false)" :
1185
+ "ALTER SUBSCRIPTION ... DROP PUBLICATION ... WITH (refresh = false)" )));
1183
1186
1184
1187
/*
1185
1188
* See ALTER_SUBSCRIPTION_REFRESH for details why this is
1186
1189
* not allowed.
1187
1190
*/
1188
1191
if (sub -> twophasestate == LOGICALREP_TWOPHASE_STATE_ENABLED && opts .copy_data )
1189
1192
ereport (ERROR ,
1190
- (errcode (ERRCODE_SYNTAX_ERROR ),
1193
+ (errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
1191
1194
errmsg ("ALTER SUBSCRIPTION with refresh and copy_data is not allowed when two_phase is enabled" ),
1192
- errhint ("Use ALTER SUBSCRIPTION ...SET PUBLICATION with refresh = false, or with copy_data = false"
1193
- ", or use DROP/CREATE SUBSCRIPTION." )));
1195
+ /* translator: %s is an SQL ALTER command */
1196
+ errhint ("Use %s with refresh = false, or with copy_data = false, or use DROP/CREATE SUBSCRIPTION." ,
1197
+ isadd ?
1198
+ "ALTER SUBSCRIPTION ... ADD PUBLICATION" :
1199
+ "ALTER SUBSCRIPTION ... DROP PUBLICATION" )));
1194
1200
1195
1201
PreventInTransactionBlock (isTopLevel , "ALTER SUBSCRIPTION with refresh" );
1196
1202
@@ -1235,8 +1241,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
1235
1241
ereport (ERROR ,
1236
1242
(errcode (ERRCODE_SYNTAX_ERROR ),
1237
1243
errmsg ("ALTER SUBSCRIPTION ... REFRESH with copy_data is not allowed when two_phase is enabled" ),
1238
- errhint ("Use ALTER SUBSCRIPTION ... REFRESH with copy_data = false"
1239
- ", or use DROP/CREATE SUBSCRIPTION." )));
1244
+ errhint ("Use ALTER SUBSCRIPTION ... REFRESH with copy_data = false, or use DROP/CREATE SUBSCRIPTION." )));
1240
1245
1241
1246
PreventInTransactionBlock (isTopLevel , "ALTER SUBSCRIPTION ... REFRESH" );
1242
1247
@@ -1852,8 +1857,8 @@ ReportSlotConnectionError(List *rstates, Oid subid, char *slotname, char *err)
1852
1857
1853
1858
ereport (ERROR ,
1854
1859
(errcode (ERRCODE_CONNECTION_FAILURE ),
1855
- errmsg ("could not connect to publisher when attempting to "
1856
- "drop replication slot \"%s\": %s" , slotname , err ),
1860
+ errmsg ("could not connect to publisher when attempting to drop replication slot \"%s\": %s" ,
1861
+ slotname , err ),
1857
1862
/* translator: %s is an SQL ALTER command */
1858
1863
errhint ("Use %s to disassociate the subscription from the slot." ,
1859
1864
"ALTER SUBSCRIPTION ... SET (slot_name = NONE)" )));
0 commit comments