Re: [PATCH] minor bugfix for pg_basebackup (9.6 ~ ) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] minor bugfix for pg_basebackup (9.6 ~ )
Date
Msg-id 20190720010419.GA1768@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] minor bugfix for pg_basebackup (9.6 ~ )  (Ian Barwick <ian.barwick@2ndquadrant.com>)
Responses Re: [PATCH] minor bugfix for pg_basebackup (9.6 ~ )  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Fri, Jul 19, 2019 at 10:40:42PM +0900, Ian Barwick wrote:
> Good point, it does actually fail with an error if an impossible slot name
> is provided, so the escaping is superfluous anyway.

FWIW, ReplicationSlotValidateName() gives the reason behind that
restriction:
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.

> I'll take another look at it later as it's not exactly critical, just stuck
> out when I was passing through the code.

This restriction is unlikely going to be removed, still I would rather
keep the escaped logic in pg_basebackup.  This is the usual,
recommended coding pattern, and there is a risk that folks refer to
this code block for their own fancy stuff, spreading the problem.  The
intention behind the code is to use an escaped name as well.  For
those reasons your patch is fine by me.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Catching missing Datum conversions
Next
From: Michael Paquier
Date:
Subject: Re: Compile from source using latest Microsoft Windows SDK