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 1tITBu-00EXJu-F7 for pgsql-novice@arkaria.postgresql.org; Tue, 03 Dec 2024 13:43:50 +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 1tITBr-009y4p-Ug for pgsql-novice@arkaria.postgresql.org; Tue, 03 Dec 2024 13:43:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIOjC-008cL4-Q1 for pgsql-novice@lists.postgresql.org; Tue, 03 Dec 2024 08:57:56 +0000 Received: from sender4-of-o52.zoho.com ([136.143.188.52]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIOjA-000nty-LW for pgsql-novice@lists.postgresql.org; Tue, 03 Dec 2024 08:57:55 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1733216269; cv=none; d=zohomail.com; s=zohoarc; b=Z59zfYuPTuywmIW3cQFUsFlcb4xjuAbEoZyCQRIO0ZAn/hzDYvUpV6hm4x3nxg5UboLnTzLfx9rFdin7o5iwT3I4lO1G7JAJRU5oMTDmPUtf7XKMvDcRU13xpUS3pmH+yuAE6V0rG1xdsJexmlRymeoyw/KzIF1DCJD5X31J6B8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733216269; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=0VV7cEYhZ/jWDU21HZpEaigjNtsPv+/dXQ9VfJG/6X4=; b=Wy02EQTOrPE2eLAwzMHxx9VVuAmE7YVvdG4WGVnwfdGeQ3UBzxeUoXsONRZXIeuEy2NVFEXU9We1NiqRbdkpfBBBzzyF9BFr4lHDiUhX8DiMhV+2vxyiFoT7REcSgMmvMjZiwi8N4OYdAKNfwb90vj/xxOOxQErmca0hDlTKdnU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass smtp.mailfrom=ken@beckydibble.com; dmarc=pass header.from= Received: by mx.zohomail.com with SMTPS id 1733216266566156.61722326081247; Tue, 3 Dec 2024 00:57:46 -0800 (PST) Message-ID: <8f904f5d-4f19-40c2-97dd-32b974253b01@beckydibble.com> Date: Tue, 3 Dec 2024 03:57:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Command Line option misunderstanding To: pgsql-novice@lists.postgresql.org 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-Language: en-US From: Ken Dibble In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ZohoMailClient: External List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/3/24 01:12, Laurenz Albe wrote: > 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 >> that the problem only exists when using -c on the same line as -v. >> I am guessing here, that my original question should have been: >> >> "Why is it okay to use a psql variable declared on a command line in a psql session >> that was started from said command line and not with a session that was created 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 commit > 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 changes > it. There might be some resistence, however, because a behavoir change like that > could break existing scripts and persent a backward incompatibility. > > Yours, > Laurenz Albe > Thanks for your time and explanations. Ken