Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlUoS-00D5oj-0d for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jan 2026 16:24:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vlUoR-00AK3X-0Q for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jan 2026 16:24:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlUoQ-00AK3O-2f for pgsql-hackers@lists.postgresql.org; Thu, 29 Jan 2026 16:24:07 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlUoO-002wyQ-1L for pgsql-hackers@lists.postgresql.org; Thu, 29 Jan 2026 16:24:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 60TGNxlU1235913; Thu, 29 Jan 2026 11:23:59 -0500 From: Tom Lane To: Andrew Dunstan cc: Mahendra Singh Thalor , Nathan Bossart , =?UTF-8?Q?=C3=81lvaro_Herrera?= , Srinath Reddy , pgsql-hackers@lists.postgresql.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 In-reply-to: References: <202504061734.mtvroeo3gn33@alvherre.pgsql> <2967167.1743961909@sss.pgh.pa.us> Comments: In-reply-to Andrew Dunstan message dated "Thu, 29 Jan 2026 09:37:36 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1235911.1769703839.1@sss.pgh.pa.us> Date: Thu, 29 Jan 2026 11:23:59 -0500 Message-ID: <1235912.1769703839@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: > These patches need a little copy editing (e.g. > "check_database_role_names_in_old_cluser" seems to be missing a "t") and > the error messages and comments need some tidying, but I think they are > basically sound. > Is there any objection to them in principle? +1 in principle. As you say, there's some tidying needed. A couple of points I noted: 1. check_lfcr_in_objname is about as unmusical a name as I can readily imagine. I was thinking about proposing "reject_newline_in_name" instead, but really I would drop that subroutine altogether and just code the checks in-line, because: 2. I don't think this approach to constructing the error message meets our translatability guidelines. Better to just write out "role name \"%s\" contains ..." or "database name \"%s\" contains ...". We do use the other approach in some cases where it saves dozens of repetitive messages, but when there are only ever going to be two I'd rather err on the side of translatability. 3. I do not like the tests added to 040_createuser.pl, as they do not verify that the command fails for the expected reason. 4. There's no point in running check_database_role_names_in_old_cluser against a v19 or later source server. regards, tom lane