Hi, While reviewing another patch, I noticed that START_REPLICATION fails to parse publication names that contain backslash characters (e.g. \0, \n), even though such names are perfectly valid when used with CREATE PUBLICATION. This can be reproduced with the following: CREATE PUBLICATION "regress_pub_\0\n"; CREATE SUBSCRIPTION regress_sub CONNECTION 'dbname=postgres host=localhost port=5432' PUBLICATION "regress_pub_\0\n";
CREATE PUBLICATION allows quoted identifiers that may include backslashes. However, when the subscriber sends such a publication name back to the walsender as part of START_REPLICATION, the replication grammar rejects it and throws a syntax error. This happens because the publication name is passed through escape string processing before being sent, even though the replication grammar does not accept escape string forms. The attached patch removes the unnecessary escape-string handling and passes the publication name as it is. Replication grammar does not require escape string processing here, and sending the raw identifier ensures consistent behaviour between CREATE PUBLICATION and START_REPLICATION. Regards, Vignesh
0001-Fix-START_REPLICATION-failure-when-publication-names.patch
Description: Binary data
