From: Alvaro Herrera Date: Fri, 26 Jul 2019 21:46:40 +0000 (-0400) Subject: Don't uselessly escape a string that doesn't need escaping X-Git-Tag: REL_12_BETA3~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ac684381df1783b0855d3b53b1c6d4736843695;p=postgresql Don't uselessly escape a string that doesn't need escaping Per gripe from Ian Barwick Co-authored-by: Ian Barwick Discussion: https://postgr.es/m/CABvVfJWNnNKb8cHsTLhkTsvL1+G6BVcV+57+w1JZ61p8YGPdWQ@mail.gmail.com --- diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 15f43f9432..068404887d 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1712,9 +1712,9 @@ GenerateRecoveryConf(PGconn *conn) if (replication_slot) { - escaped = escape_quotes(replication_slot); - appendPQExpBuffer(recoveryconfcontents, "primary_slot_name = '%s'\n", replication_slot); - free(escaped); + /* unescaped: ReplicationSlotValidateName allows [a-z0-9_] only */ + appendPQExpBuffer(recoveryconfcontents, "primary_slot_name = '%s'\n", + replication_slot); } if (PQExpBufferBroken(recoveryconfcontents) ||