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.94.2) (envelope-from ) id 1u1XGe-0040DW-1o for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Apr 2025 21:11:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u1XGc-002upf-C7 for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Apr 2025 21:10:58 +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.94.2) (envelope-from ) id 1u1XGb-002upX-P1 for pgsql-hackers@lists.postgresql.org; Sun, 06 Apr 2025 21:10:58 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u1XGZ-003La2-1b for pgsql-hackers@lists.postgresql.org; Sun, 06 Apr 2025 21:10:56 +0000 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6e8f06e13a4so46624626d6.0 for ; Sun, 06 Apr 2025 14:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1743973853; x=1744578653; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=WwJE9zRJRu0Gea1vJHjcUw3QaS+CVDED0iqFtv2nMWo=; b=Z9Q7H7AI0Ysya7rJj14OCwyEhncfszwj2jrOvNuzLv4G5esNZ5qXTD9B2YIp6uQv/e ere9DBdKErckW9JXQ14cUCk5mUPCAhLdRHKrxdNvI6cWpFkaPLqHJI+9eD4Dbu1Zs7Sq 6MSX5g7LJs4e/EHNlakh+T2aq3fUM9fUF3BpvIdHb2o0JryAISYj8tnNBgxg24R5PB7u NdSLGyCC95jdv1+Wb9Z+L4OlX61daYvRKtrbX91I5Uj1UeoIsNbswyb3IESX/pa9pmKB KDWiJIpavzA4DX8rA9xGp995BZz9QA6PKzdSp+MwUqto4Pz3F08B75ZvrBLKoyNOLUKi iPzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743973853; x=1744578653; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WwJE9zRJRu0Gea1vJHjcUw3QaS+CVDED0iqFtv2nMWo=; b=WJ4+WI91CnqYwH589XcFT8bEjDm3mRQyzBwHiqiaBEBiCtDIXhx5qXp1pMdR+iiz4B n/KXpiWaM61pO0st1YEEuUFnGHWt87S0T+b86n0kzdVgVoh8MaKwOl+xoQPqe9aQmChj LU3KL3HIRh31encrFiqj/mIdv9LO32w+V6dAyDDHoOv9UZg83YKOXSVwlZSoY2/n+1el Qy1QtthF7dvs9MFURG0Pb1bMYMYhimHJ+KNr9hDXNbR97+4OBOqHZOedGbayiTo9oSe0 dzJCNO7MsAMZY5Uj9h+ZAWm9iVi7BRzt4hlpgM4IMds10On9k2HO1Y+D5B3fy0lJnTwK WAuw== X-Forwarded-Encrypted: i=1; AJvYcCVEShrRA+8n/okmbmqY+pyELdk5WWnlnLtQY1OKqGIISP2GPMjj/WPvT9oXuHOK7XDQp8oQI4948nCLFGRh@lists.postgresql.org X-Gm-Message-State: AOJu0Yx1o/Hj2yG6Jtd4k/o4F6KAgTkw+hLJcn3ketDJT/iBjtVi4PQb MgdLQfBmvodO+M0JUj/dgupgwA0FC6l+C7ucMLO2+IkrbsCHdn8zjNzGbEmpgzA= X-Gm-Gg: ASbGnctPWoFLoyEwMD9sdyWA7OMfsgp/r5Mfmtz1ZWyDfwieQOK85N0n/96cGcyHrKP Crdx6N5GRszPapzQc9Z3QbgmFHK1bZnBIMDNxnbr5zDQyp5l5l8swyFLEKSIzdSmwCkQwzAEx3V jHfk98GhB7TrL49XgVcsB5Z5I560Ho0VR+usdunjQxpJd6eWQsvqVE4Zty2AzbUYYfo5hr4zpVW R1ENT54NmyZ3rfFaB/D5G9vXDL0MR7YySFU2h6s85GhHvc7Mp7TA33J/FoTagfLqR1rExSfdOWC YkvFyhS00dl6EJEwz04cc2gxlgiMPav3j2LphFKBVlZqVXAzUqdM8Vs= X-Google-Smtp-Source: AGHT+IF5B4xx1X+YweI0px24N3JO3ywlM9arbNn+06ToB/7QIsM3sD3uD/YIYfXwa3YmDC9/3cNSLQ== X-Received: by 2002:a05:6214:2a8c:b0:6e5:a0fc:f65d with SMTP id 6a1803df08f44-6ef0be7d869mr201885536d6.10.1743973853557; Sun, 06 Apr 2025 14:10:53 -0700 (PDT) Received: from ?IPV6:2605:a601:a681:6b00::1cb? ([2605:a601:a681:6b00::1cb]) by smtp.googlemail.com with ESMTPSA id 6a1803df08f44-6ef0f16535bsm49878336d6.123.2025.04.06.14.10.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Apr 2025 14:10:53 -0700 (PDT) Message-ID: Date: Sun, 6 Apr 2025 17:10:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird 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 To: Tom Lane , =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Nathan Bossart , Mahendra Singh Thalor , Srinath Reddy , pgsql-hackers@lists.postgresql.org References: <202504061734.mtvroeo3gn33@alvherre.pgsql> <2967167.1743961909@sss.pgh.pa.us> From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp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kZOnteZJZ+GbxQVlINt6fd8P6al3MWOvpP/ExJPguEfjOsO6Njy xjo3WfpD4lHMOR/Oc3/8mScEF84rF2jXbsFgelWnbPWAvXY+pD0dXOFRkagGmC/viwBDqq5b 5tk76kKmUbZxABEBAAHCwHwEGAEIACYCGwwWIQTkPlhGHfx8v0RpFaWZ+n/LWfw7gQUCZFlx 5wUJGVGAjgAKCRCZ+n/LWfw7gf+iB/4g8CPY5jihf5r/8EsoIGe2H+dpVmpPF8YGBzTIvCz/ fQoOq8AX/pE76QEuFnFZWfjw+wgBXgCVmkox2Eflkk6z4ND3pcwGZ6CfCxTQCDk/dij+2DQ4 6bmDCy/sBgcbz9mTpoLC11HLoPae6YN9nBNQRZDcEFEu54OaVOqlIdbA6m+POIBCXZdHOFc0 WoDTgxHRzC1jgQNidyd6tKqcsVJs0dzF0oKTmFFmUAqTdJO12LBuNA1rlqrR3EtpYk8B/wtS 5dIMD7Q8hwQpL+4C6GNpb6ZKnPkLi47pDOLhz2qBrqN+rqUEsT3YnExYpzj5yOBi+FlmV1Hw 49QYe1sn2ZPs In-Reply-To: <2967167.1743961909@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-04-06 Su 1:51 PM, Tom Lane wrote: > =?utf-8?Q?=C3=81lvaro?= Herrera writes: >> On 2025-Apr-06, Tom Lane wrote: >>> If we can cite the SQL standard then it's an entirely defensible >>> restriction. >> We can. It says (in 5.2 and ) >> ::= >> ::= [ ... ] >> ::= | >> ::= !! See the Syntax Rules. >> ::= !! See the Syntax Rules. > Hmm, but that's about non-quoted identifiers, so of course their > character set is pretty restricted. What's of concern here is > what's allowed in double-quoted identifiers. AFAICS there's > not much restriction: it can be any , > and SR 7 says > > 7) A is any character of the source > language character set other than a . > > NOTE 115 — “source language character set” is defined in > Subclause 4.10.1, “Host languages”, in ISO/IEC 9075-1. > > The referenced bit of 9075-1 is pretty vague too: > > No matter what binding style is chosen, SQL-statements are written > in an implementation-defined character set, known as the source > language character set. The source language character set is not > required to be the same as the character set of any character > string appearing in SQL-data. > > So I'm not really seeing anything there that justifies forbidding any > characters. However, I still think that if we're going to forbid CR > or LF, we might as well go the whole way and forbid all the ASCII > control characters; none of them are any saner to use in identifiers > than those two. (I'd be for banning   and similar as well, on > the same usability grounds as banning tabs, except that putting an > encoding dependency into this rule will not end well.) Sound like we have some work to do, and that's not going to happen in 24 hours. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com