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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Álvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andrew Dunstan <andrew@dunslane.net>, Mahendra Singh Thalor <mahi6run@gmail.com>, Nathan Bossart <nathandbossart@gmail.com>, Srinath Reddy <srinath2133@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2026-02-02T14:14:28Z
Lists: pgsql-hackers
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@alvh.no-ip.org> writes:
> This is not an objection to this patch, but I don't see why we should
> allow newlines in tablespace names if we're going to restrict them in
> names of roles and databases.  Is it only because pg_dumpall happens not
> to dump a comment with the tablespace name on it, like we do for dbs and
> roles?  Sounds unprincipled.
> I think keeping these things under the same rules makes the most sense.

Yeah, I was thinking the same.

			regards, tom lane



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Disallow CR and LF in database, role, and tablespace names

  2. Switch the regression tests of pg_upgrade to use TAP tests