]> granicus.if.org Git - postgresql/commitdiff
Improve errhint() about replication slot naming restrictions.
authorAndres Freund <andres@anarazel.de>
Sat, 3 Oct 2015 13:29:08 +0000 (15:29 +0200)
committerAndres Freund <andres@anarazel.de>
Sat, 3 Oct 2015 13:29:35 +0000 (15:29 +0200)
The existing hint talked about "may only contain letters", but the
actual requirement is more strict: only lower case letters are allowed.

Reported-By: Rushabh Lathia
Author: Rushabh Lathia
Discussion: AGPqQf2x50qcwbYOBKzb4x75sO_V3g81ZsA8+Ji9iN5t_khFhQ@mail.gmail.com
Backpatch: 9.4-, where replication slots were added

contrib/test_decoding/expected/ddl.out
src/backend/replication/slot.c

index 728798b3b7344d039c53480dc5a7c3d94b9a9ef7..a48d42c5a142217a26c7ecdfe3c1a641068e5698 100644 (file)
@@ -12,7 +12,7 @@ ERROR:  replication slot "regression_slot" already exists
 -- fail because of an invalid name
 SELECT 'init' FROM pg_create_logical_replication_slot('Invalid Name', 'test_decoding');
 ERROR:  replication slot name "Invalid Name" contains invalid character
-HINT:  Replication slot names may only contain letters, numbers, and the underscore character.
+HINT:  Replication slot names may only contain lower case letters, numbers, and the underscore character.
 -- fail twice because of an invalid parameter values
 SELECT 'init' FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', 'frakbar');
 ERROR:  could not parse value "frakbar" for parameter "include-xids"
index abe8747fe4de401f9c63cc396766a0b8a1f1e2a5..41389030b67b65eb0779546fd4e7bf9ccd49c84d 100644 (file)
@@ -195,7 +195,7 @@ ReplicationSlotValidateName(const char *name, int elevel)
                                        (errcode(ERRCODE_INVALID_NAME),
                        errmsg("replication slot name \"%s\" contains invalid character",
                                   name),
-                                        errhint("Replication slot names may only contain letters, numbers, and the underscore character.")));
+                                        errhint("Replication slot names may only contain lower case letters, numbers, and the underscore character.")));
                        return false;
                }
        }