From: | Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Danger of automatic connection reset in psql |
Date: | 2016-11-14 11:41:21 |
Message-ID: | CACACo5Q5wW6R=-y+NPmeDOV0p7kRhFNbpF+0AXQNRVL22nTGUA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Nov 11, 2016 at 5:37 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:
>
> 2016-11-11 5:14 GMT+01:00 Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
> :
>
>> >
>> > How about, instead of all this, adding an option to psql to suppress
>> > the automatic reconnect behavior? When enabled, psql just exits
>> > instead of trying to reconnect.
>> >
>> +1. But, existing users may not notice addition of the new option and
>> still continue to face problem. If we add the option and make it
>> default not to reconnect, they will notice it and use option to get
>> older behaviour, but that will break applications relying on the
>> current behaviour. Either way, users will have at least something to
>> control the connection reset.
>>
>
> The reconnect in not interactive mode is a bad idea - and there should be
> disabled everywhere (it cannot to break any application - the behave of
> script when a server is restarted must be undefined (100% if ON_ERROR_STOP
> is active). In interactive mode it can be controlled by some psql session
> variables like AUTOCOMMIT.
>
Yes, I've never suggested it should affect non-interactive mode.
Automatic connection reset is a nice feature for server development, IMO.
Is it really useful for anything else is a good question.
At least an option to control that behavior seems like a good idea, maybe
even set it to 'no reconnect' by default, so that people who really use it
can make conscious choice about enabling it in their .psqlrc or elsewhere.
--
Alex
From | Date | Subject | |
---|---|---|---|
Next Message | valeriof | 2016-11-14 11:45:28 | Re: Transaction user id through logical decoding |
Previous Message | Amit Kapila | 2016-11-14 11:23:35 | Re: Fix checkpoint skip logic on idle systems by tracking LSN progress |