Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, Srinath Reddy <srinath2133(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote
Date: 2025-04-06 16:10:06
Message-ID: 64EEE0C9-0461-4412-BADA-1C108E98BC1B@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Sent from my iPhone

> On Apr 6, 2025, at 11:23 AM, Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> On 2025-Apr-06, Andrew Dunstan wrote:
>
>> On 2025-03-28 Fr 10:43 AM, Nathan Bossart wrote:
>
>>> Taking a step back, are we sure that 1) this is the right place to do these
>>> checks and 2) we shouldn't apply the same restrictions to all names? I'm
>>> wondering if it would be better to add these checks to the grammar instead
>>> of trying to patch up all the various places they are used in the tree.
>>
>> Maybe. I don't think there is time for that for v18, so we'd have to defer
>> this for now. I can live with that - it's been like this for a long time.
>
> Grumble. I'd rather introduce a partial restriction now only for names
> that affect the tools failing outright (pg_dumpall in particular), than
> do nothing for this release. If we feel the need to extend the
> restriction later, that's easy to do and bothers nobody. We've wanted
> these characters to be forbidden on database names for a long time, but
> nobody has cared as much for their use on other types of names. I'm not
> even sure we'd support the idea of forbidding them on all names (though
> the SQL standard doesn't allow control chars in identifiers.)

Ok. That seems reasonable, let’s do this now and revisit in the v19 cycle

Cheers

Andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mahendra Singh Thalor 2025-04-06 16:10:58 Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote
Previous Message Álvaro Herrera 2025-04-06 15:23:35 Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote