Re: BUG #15598: PostgreSQL Error Code is not reported when connectionterminated due to idle-in-transaction timeout - Mailing list pgsql-bugs

From Marcin Barczyński
Subject Re: BUG #15598: PostgreSQL Error Code is not reported when connectionterminated due to idle-in-transaction timeout
Date
Msg-id CAP3o3PdzM0BLmNBELA5wV6YoN_1yYBVdoOvz9kYbOuK-YQGFAw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15598: PostgreSQL Error Code is not reported when connection terminated due to idle-in-transaction timeout  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #15598: PostgreSQL Error Code is not reported when connection terminated due to idle-in-transaction timeout
List pgsql-bugs
On Fri, Jan 18, 2019 at 5:45 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> This is not the default appearance of psql error reports.
> I'd venture that you are setting VERBOSITY=verbose in your
> environment, perhaps in ~/.psqlrc.  If you want the same
> behavior on your Windows machine, you need to do that there too.

Unfortunately, it's not the problem of verbosity.
The error code is printed properly in case of duplicate key violation. It seems that something is wrong with idle-in-transaction timeout on Windows:

postgres=# \set VERBOSITY verbose
postgres=# SET idle_in_transaction_session_timeout=500;
SET
postgres=# BEGIN;
BEGIN
postgres=# SELECT * FROM pg_class;
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
postgres=# CREATE TABLE demo (key BIGINT PRIMARY KEY);
CREATE TABLE
postgres=# INSERT INTO demo VALUES (1);
INSERT 0 1
postgres=# INSERT INTO demo VALUES (1);
ERROR:  23505: duplicate key value violates unique constraint "demo_pkey"
DETAIL:  Key (key)=(1) already exists.
SCHEMA NAME:  public
TABLE NAME:  demo
CONSTRAINT NAME:  demo_pkey
LOCATION:  _bt_check_unique, nbtinsert.c:433


Best regards,
Marcin

pgsql-bugs by date:

Previous
From: Amit Langote
Date:
Subject: Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
Next
From: Andrew Gierth
Date:
Subject: Re: BUG #15598: PostgreSQL Error Code is not reported when connection terminated due to idle-in-transaction timeout