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: Srinath Reddy <srinath2133(at)gmail(dot)com>, Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>
Cc: 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-03-26 12:25:15
Message-ID: b3b91d97-fada-4700-a3fc-842566fbd537@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2025-03-26 We 3:04 AM, Srinath Reddy wrote:
>
> I have reviewed all solutions but based on the commit message and
> comments, it is clear that the goal is to *entirely forbid database
> names containing carriage return (CR) or line feed (LF)* characters.
> *Solution 1 LGTM and aligns with this approach* by enforcing the
> restriction at the time of database creation, ensuring consistency
> throughout PostgreSQL. This approach eliminates ambiguity and
> guarantees that such database names *cannot be created or dumped with
> CR or LF.*
>
> To validate this behavior, I have also implemented a *TAP test* for
> Solution 1.
>

You can still create a database with these using "CREATE DATABASE"
though. Shouldn't we should really be preventing that?

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2025-03-26 12:35:37 Re: Allow default \watch interval in psql to be configured
Previous Message Daniel Gustafsson 2025-03-26 12:24:39 Re: Allow default \watch interval in psql to be configured