Skip to content

Commit cfddb5d

Browse files
committed
Improve errhint() about replication slot naming restrictions.
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
1 parent 7285d66 commit cfddb5d

File tree

2 files changed

+2
-2
lines changed
  • contrib/test_decoding/expected
  • src/backend/replication

2 files changed

+2
-2
lines changed

contrib/test_decoding/expected/ddl.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ERROR: replication slot "regression_slot" already exists
1212
-- fail because of an invalid name
1313
SELECT 'init' FROM pg_create_logical_replication_slot('Invalid Name', 'test_decoding');
1414
ERROR: replication slot name "Invalid Name" contains invalid character
15-
HINT: Replication slot names may only contain letters, numbers, and the underscore character.
15+
HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character.
1616
-- fail twice because of an invalid parameter values
1717
SELECT 'init' FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', 'frakbar');
1818
ERROR: could not parse value "frakbar" for parameter "include-xids"

src/backend/replication/slot.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ ReplicationSlotValidateName(const char *name, int elevel)
195195
(errcode(ERRCODE_INVALID_NAME),
196196
errmsg("replication slot name \"%s\" contains invalid character",
197197
name),
198-
errhint("Replication slot names may only contain letters, numbers, and the underscore character.")));
198+
errhint("Replication slot names may only contain lower case letters, numbers, and the underscore character.")));
199199
return false;
200200
}
201201
}

0 commit comments

Comments
 (0)