BUG #14250: Error in subquery fails silently and parent query continues to execute

From: jason(at)signalvine(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14250: Error in subquery fails silently and parent query continues to execute
Date: 2016-07-14 13:52:33
Message-ID: 20160714135233.1410.92538@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: 14250
Logged by: jason turim
Email address: jason(at)signalvine(dot)com
PostgreSQL version: 9.5.3
Operating system: Ubuntu 14.04 / Mac 10.11.5 (15F34)
Description:

create table parent (id serial primary key, name text);
create table child (id serial primary key, parent_id int, name text);

insert into parent (name) values ('a');
insert into parent (name) values ('b');
insert into parent (name) values ('c');

insert into child (name, parent_id) values ('x', 1);
insert into child (name, parent_id) values ('y', 1);
insert into child (name, parent_id) values ('z', 1);

insert into child (name, parent_id) values ('r', 2);
insert into child (name, parent_id) values ('s', 2);
insert into child (name, parent_id) values ('t', 2);

insert into child (name, parent_id) values ('m', 3);
insert into child (name, parent_id) values ('n', 3);
insert into child (name, parent_id) values ('o', 3);

-- the sub-query contains an error, there is no parent_id in the parent
table
-- we'd expect the following query to fail, however, all the records in the
child table are deleted
delete from child where parent_id in (select parent_id from parent where id
= 1);

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-07-14 14:07:56 Re: BUG #14249: In FDW, variable not found in subplan target list
Previous Message wayne.warren 2016-07-14 13:27:44 BUG #14249: In FDW, variable not found in subplan target list