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 1tIM9e-00Dpuq-7B for pgsql-novice@arkaria.postgresql.org; Tue, 03 Dec 2024 06:13:02 +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 1tIM9b-007Ey6-Hj for pgsql-novice@arkaria.postgresql.org; Tue, 03 Dec 2024 06:13:00 +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 1tIM9b-007Exx-8f for pgsql-novice@lists.postgresql.org; Tue, 03 Dec 2024 06:13:00 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tIM9Z-000mC9-Jz for pgsql-novice@lists.postgresql.org; Tue, 03 Dec 2024 06:12:58 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a9a68480164so695723666b.3 for ; Mon, 02 Dec 2024 22:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1733206376; x=1733811176; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=bKxV18GsrjDeGIYgp9ABxUL6T0iqI2U+k0TUcpcAjAU=; b=nHUgSpScVn5Zj3qvqkaXW9fffyNaOOgmhXpVC2mUgbsEZGeSD27TOVuFyT5Fg9UHvD 3HB3DZ44vZa9ymnMHCceJjt6Y+zS7cn1IYmi5kr7qnzOLTXatuhClRFTwGkxy9AwG35/ +MqdmlQXQt8MaY5Ezi6+GFdoDJ44EKKtQJu1IHnkJiP+1WD6/XQ9SRF3bsjgtnNYim1d N1Pya5GA/kQ4e0UaTIrXIEgkNFKe3T4xjHXK/PHiGIINqTcqT0JTvX2jF6Am0M9feXfL XOS4VhSURZGlP0QORSw9tQxfSNcC8eXdMMsl3WE7eIfDFeg/Zc+Jd9P9sDwxJwJm7wgI RU2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733206376; x=1733811176; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bKxV18GsrjDeGIYgp9ABxUL6T0iqI2U+k0TUcpcAjAU=; b=LR7DyMKtPo+cBkoRgZ75gsTCNLvMdKnetINjx06C4az/9Dk2eIYPK5476WueJ5MZwj sZVQ1osVsnF47rqD8i6X1N6s/6fIIJi9Bqo1SRnpCdafEWYkPS5Eq/mJlpTANZ7NKybG LyoHgiC14STExuTiy1et9ON3DXTL2xvzsprZ8c/BEa8L+hJED/nTEPfktF4Va2zxH3Qs uzXWNnOLpE94KWtkOlicMCN0tYh1iUZpzRUAPf5Bp9ZqJ9tR4gkTDwQtHI+iRT2wKm3p xovpRpxKMSI7iHcY4V+SXj1P8NT4yJSP7yAESSTHl2T+/nuEN2eC7wi68U+bJV7cvjtf BGuQ== X-Forwarded-Encrypted: i=1; AJvYcCWd8KIEduggR9wuXeG2C8KqeQu9eTAny9QlxZ3I6Ogo1njUxeYKn7uuHkICOG4jC3lCNL1g7sU7UqaSRdI=@lists.postgresql.org X-Gm-Message-State: AOJu0Yy2Smbas7y9uHQi1bcD6DGQZ/t4xcGqs21w64EFpxpFo/B8gs+J sY7bQYVbuoxcmHYo/cSS7rhKyOK3RTosoXw33Ms342yEq7IBytrBbifwPygZ8VI= X-Gm-Gg: ASbGncuS17hVxeUkPnG66kkCP+7sh1Gdymp2ztN3r/WgfK8Jn2hwfD1AMBtA86oQ29R 9w0/Dt6XkLZkz7/wKhniCIxer3h0nOYxpIADeHlyldXIyGVPTqSTMJEk5TCSFBStHfxM0Ohj8+3 fSybowbA+z3juuEy2cDWtH+FstRg1eVYw9mBsoB9P3mh7vpCM0KP4imsrNdV/BgX4FXkdgIeBYF bXwBW6xIba2YBMQEqljHxIdOY/9VJlR2d1L627Q7CCdhMsbxjJWEkQRUVy9L0Mz+vdflKABaBr2 uE7vFALaP0UvulRauiNhTJlp39vkmPbjf7SS+oz1rGMoe0DcSA== X-Google-Smtp-Source: AGHT+IGqYSHNhg5YznIlLV4RgPVORboB0vh5N0rNhUdfytsHjYNfO48kxdKTMddG3yf5nV7CHnbU2g== X-Received: by 2002:a17:906:2922:b0:aa5:2575:e76a with SMTP id a640c23a62f3a-aa5f7d154e9mr72826266b.13.1733206375721; Mon, 02 Dec 2024 22:12:55 -0800 (PST) Received: from localhost.localdomain (dslb-002-200-202-108.002.200.pools.vodafone-ip.de. [2.200.202.108]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa5998e716fsm578703766b.108.2024.12.02.22.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 22:12:55 -0800 (PST) Message-ID: Subject: Re: Command Line option misunderstanding From: Laurenz Albe To: punch-hassle-guise@duck.com, "pgsql-novice@lists.postgresql.org" Date: Tue, 03 Dec 2024 07:12:54 +0100 In-Reply-To: References: <487DB217-EA37-4139-AB97-B61B04ECAEA7.1@smtp-inbound1.duck.com> <493C622D-D3B6-4662-A617-EBCCDE5AA4DF.1@smtp-inbound1.duck.com> <30948e6771500c0e9d8b587f4e34165aadb1cc0b.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-2.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2024-12-02 at 18:49 -0500, punch-hassle-guise@duck.com wrote: > The problem seems to be, as alluded to by others attempting to help me=C2= =A0 > that the problem only exists when using -c on the same line as -v.=C2=A0 > I am guessing here, that my original question should have been: >=20 > "Why is it okay to use a psql variable declared on a command line in a ps= ql session > that was started from said command line and not with a session that was c= reated and > destroyed with a -c command switch?" "Why" questions tend to be difficult to answer. The simple answer is: because somebody implemented it that way. I dug into the commit history, and the current behavior seems to stem from = commit a45195a191 from 1999 that introduced psql variables and has the lapidary co= mmit message "Major psql overhaul by Peter Eisentraut". I couldn't find a pertinent discussion on the list. If you dislike the current behavior enough, you could write a patch that ch= anges it. There might be some resistence, however, because a behavoir change lik= e that could break existing scripts and persent a backward incompatibility. Yours, Laurenz Albe