Why can't we used CAPITAL LETTERS into replication slot_name?

Started by Rushabh Lathiaover 10 years ago4 messages
#1Rushabh Lathia
rushabh.lathia@gmail.com

Hi,

I am just wondering why pg_create_physical_replication_slot() can't take
CAPITAL LETTERS into slot_name ?

Comment over ReplicationSlotValidateName() says that - Slot names may
consist out of [a-z0-9_]{1,NAMEDATALEN-1} which should allow the name to be
used as a directory name on every supported OS.

If its by design then was should atleast change the hint into
ReplicationSlotValidateName() which says: "Replication slot names may only
contain letters, numbers, and the underscore character."

Comments ?

Regards,
Rushabh Lathia
www.EnterpriseDB.com

#2Andres Freund
andres@anarazel.de
In reply to: Rushabh Lathia (#1)
Re: Why can't we used CAPITAL LETTERS into replication slot_name?

Hi,

On 2015-09-25 17:32:39 +0530, Rushabh Lathia wrote:

I am just wondering why pg_create_physical_replication_slot() can't take
CAPITAL LETTERS into slot_name ?

Windows. And OSX. Specifically case-insensitive filenames.

If its by design then was should atleast change the hint into
ReplicationSlotValidateName() which says: "Replication slot names may only
contain letters, numbers, and the underscore character."

We could add a 'lower case' in there.

Greetings,

Andres Freund

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Rushabh Lathia
rushabh.lathia@gmail.com
In reply to: Andres Freund (#2)
1 attachment(s)
Re: Why can't we used CAPITAL LETTERS into replication slot_name?

Thanks Andres.

PFA patch to fix the hint message.

On Fri, Sep 25, 2015 at 5:34 PM, Andres Freund <andres@anarazel.de> wrote:

Hi,

On 2015-09-25 17:32:39 +0530, Rushabh Lathia wrote:

I am just wondering why pg_create_physical_replication_slot() can't take
CAPITAL LETTERS into slot_name ?

Windows. And OSX. Specifically case-insensitive filenames.

If its by design then was should atleast change the hint into
ReplicationSlotValidateName() which says: "Replication slot names may

only

contain letters, numbers, and the underscore character."

We could add a 'lower case' in there.

Greetings,

Andres Freund

Regards,
Rushabh Lathia
www.EnterpriseDB.com

Attachments:

slot_name_hint_message_change.patchapplication/x-download; name=slot_name_hint_message_change.patchDownload
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index c66619c..a4b86e0 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -196,7 +196,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;
 		}
 	}
#4Andres Freund
andres@anarazel.de
In reply to: Rushabh Lathia (#3)
Re: Why can't we used CAPITAL LETTERS into replication slot_name?

Hi,
On 2015-09-25 17:39:41 +0530, Rushabh Lathia wrote:

PFA patch to fix the hint message.

The patched missed updating the regression test output files ;)

Committed and backpatched back to 9.4. Thanks!

- Andres

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers