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

From Andrew Dunstan
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
Msg-id b3b91d97-fada-4700-a3fc-842566fbd537@dunslane.net
Whole thread Raw
In response to Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote  (Srinath Reddy <srinath2133@gmail.com>)
Responses Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote
List 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

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Allow default \watch interval in psql to be configured
Next
From: Pavel Stehule
Date:
Subject: Re: Allow default \watch interval in psql to be configured