From: jason@signalvine.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14250: Error in subquery fails silently and parent query continues to execute
Date: Thu, 14 Jul 2016 13:52:33 +0000
Message-ID: <20160714135233.1410.92538@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14250
Logged by: jason turim
Email address: jason@signalvine.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);
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: jason@signalvine.com
Subject: Re: BUG #14250: Error in subquery fails silently and parent query continues to execute
In-Reply-To: <20160714135233.1410.92538@wrigleys.postgresql.org>
References: <20160714135233.1410.92538@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox