Re: BUG #15598: PostgreSQL Error Code is not reported when connection terminated due to idle-in-transaction timeout

From: Marcin Barczyński <mba(dot)ogolny(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marcin Barczyński <mba(dot)ogolny(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15598: PostgreSQL Error Code is not reported when connection terminated due to idle-in-transaction timeout
Date: 2019-01-21 08:55:22
Message-ID: CAP3o3PdzM0BLmNBELA5wV6YoN_1yYBVdoOvz9kYbOuK-YQGFAw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Jan 18, 2019 at 5:45 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-bugs by date

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