PGSQL bug - "Column ??? is an identity column defined as GENERATED ALWAYS.",

From: Petr Hybler <petr(dot)hybler(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: PGSQL bug - "Column ??? is an identity column defined as GENERATED ALWAYS.",
Date: 2021-08-18 15:06:54
Message-ID: CAEMmGb5BN_iRabOKO1_G6LkecxqLHrwFQ=cuN1bJC4HmUsjjLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello, I would love to report a bug for the version:
PostgreSQL 11.13 (Debian 11.13-1.pgdg100+1) on x86_64-pc-linux-gnu,
compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit

After the update, I cannot execute batch inserts. See the example below:

The table structure is as follows:

CREATE TABLE sample_table (
id int8 NOT NULL GENERATED ALWAYS AS IDENTITY,
name varchar(255) NOT NULL,
description text NOT NULL,
CONSTRAINT sample_table_pk PRIMARY KEY (id)
);

When I try to insert a single value, it works OK:

INSERT INTO sample_table (id, name, description)VALUES (DEFAULT, 'John
Doe', 'Test description');

However, when inserting multiple values, it fails:

INSERT INTO sample_table (id, name, description)VALUES (DEFAULT, 'John
Doe', 'Test description')
, (DEFAULT, 'Jane Eod', 'Not working');

Why? If I omit the DEFAULT value and PK (=id), it works great.

INSERT INTO sample_table (name, description)VALUES ('John Doe', 'Test
description')
, ('Jane Eod', 'Not working');

This worked perfectly previously.... I would appreciate if you can fix it
because I cannot do any bulkCreate operation now and I believe there will
be a lot of applications impacted

P.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-08-18 15:36:00 Re: BUG #17152: ERROR: AddressSanitizer: SEGV on unknown address
Previous Message Daniel Gustafsson 2021-08-18 13:49:48 Re: BUG #17148: About --no-strict-names option and --quiet option of pg_amcheck command