Re: Command Line option misunderstanding - Mailing list pgsql-novice

From Ken Dibble
Subject Re: Command Line option misunderstanding
Date
Msg-id 8f904f5d-4f19-40c2-97dd-32b974253b01@beckydibble.com
Whole thread Raw
In response to Command Line option misunderstanding  (punch-hassle-guise@duck.com)
List pgsql-novice
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




pgsql-novice by date:

Previous
From: Ken Dibble
Date:
Subject: Re: Command Line option misunderstanding