BUG #14421: RETURNING statement in DELETE FROM with REFERENCES

From: stepanperlov(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14421: RETURNING statement in DELETE FROM with REFERENCES
Date: 2016-11-11 22:27:11
Message-ID: 20161111222711.8761.70849@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: 14421
Logged by: Stepan Perlov
Email address: stepanperlov(at)gmail(dot)com
PostgreSQL version: 9.5.5
Operating system: ubuntu 14.04
Description:

Hello

CREATE TABLE test(
id bigserial PRIMARY KEY,
parent bigint REFERENCES test(id) ON DELETE CASCADE ON UPDATE CASCADE
);
INSERT INTO test VALUES (1, null);
INSERT INTO test VALUES (2, 1);
INSERT INTO test VALUES (3, 2);
INSERT INTO test VALUES (4, 2);
INSERT INTO test VALUES (5, 2);
INSERT INTO test VALUES (6, 2);
INSERT INTO test VALUES (7, 2);

DELETE FROM test
WHERE id = 2
RETURNING id;

Returns:
id
2

I expect:
id
2
3
4
5
6
7

Thanks

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2016-11-12 01:41:26 Re: BUG #14421: RETURNING statement in DELETE FROM with REFERENCES
Previous Message rotten 2016-11-11 22:06:57 BUG #14420: Parallel worker segfault