Skip to content

sql: DMLs with RETURNING stream results that violate constraints #22304

@jordanlewis

Description

@jordanlewis
\set display_format csv
create table a(a int primary key);
insert into a values(1);
insert into a select generate_series(1,3000) returning a;

If you run this, you'll see that the last statement returns 1 to the client immediately, despite the fact that the statement will not eventually commit because 1 violates the unique constraint.

Related to #20732.

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-0-visible-logical-errorDatabase stores inconsistent data in some cases, or queries return invalid results silently.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions