BUG #14027: n_tup_ins increments regardless of insertion success

From: matvejchikov(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14027: n_tup_ins increments regardless of insertion success
Date: 2016-03-16 21:59:10
Message-ID: 20160316215910.5232.53548@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14027
Logged by: Ilya Matveychikov
Email address: matvejchikov(at)gmail(dot)com
PostgreSQL version: 9.5.1
Operating system: Linux
Description:

postgres=# create table t (name text unique);
postgres=# select n_tup_ins from pg_stat_user_tables where relname='t';
n_tup_ins
-----------
0
postgres=# insert into t (name) values ('a');
INSERT 0 1
postgres=# select n_tup_ins from pg_stat_user_tables where relname='t';
n_tup_ins
-----------
1
postgres=# insert into t (name) values ('b');
INSERT 0 1
postgres=# select n_tup_ins from pg_stat_user_tables where relname='t';
n_tup_ins
-----------
2
postgres=# insert into t (name) values ('a');
ОШИБКА: повторяющееся значение ключа нарушает ограничение уникальности
"t_name_key"
ПОДРОБНОСТИ: Ключ "(name)=(a)" уже существует.
postgres=# select n_tup_ins from pg_stat_user_tables where relname='t';
n_tup_ins
-----------
3

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2016-03-17 01:38:30 Re: pgbench -C -M prepared gives an error
Previous Message David Gould 2016-03-16 21:00:38 Re: BUG #13750: Autovacuum slows down with large numbers of tables. More workers makes it slower.