Re: Danger of automatic connection reset in psql - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Danger of automatic connection reset in psql
Date
Msg-id 1dd3aa0f-d635-1685-b20d-586a947adc0e@BlueTreble.com
Whole thread Raw
In response to Re: Danger of automatic connection reset in psql  (Oleksandr Shulgin <oleksandr.shulgin@zalando.de>)
Responses Re: Danger of automatic connection reset in psql  (Oleksandr Shulgin <oleksandr.shulgin@zalando.de>)
List pgsql-hackers
On 11/4/16 4:04 AM, Oleksandr Shulgin wrote:
> The psql process even exits with an error code 2, which might be not
> that expected.  We could stop reading the file and reset connection
> afterwards, but this is probably not that easy to achieve (think of
> nested \i calls).

Well, if you stop reading from the file then I don't think more \i's 
will matter, no? I'd certainly like to see improvement here, because the 
difference in behavior with \i is annoying.

On the bigger question of how to better protect all these cases (cut & 
paste, etc), I think the only robust way to do that is for psql to track 
intended transaction status itself. With the amount of parsing it's 
already doing, maybe that wouldn't be that hard to add. It looks like 
this might require extra libpq calls to constantly check in on server 
status; I'm a bit surprised that result objects don't include that info.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461



pgsql-hackers by date:

Previous
From: Vicky Vergara
Date:
Subject: RV: Compilation warning on 9.5
Next
From: Tom Lane
Date:
Subject: Re: Let's get rid of SPI_push/SPI_pop