From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig James <cjames@emolecules.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Invalid SQL not rejected?
Date: Thu, 11 Apr 2013 20:44:43 -0400
Message-ID: <29413.1365727483@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFwQ8reYH0cuHhFnnv_USHrXvjmwY9+Fw_KEuqhQjecU_-bAtQ@mail.gmail.com>
References: <CAFwQ8reYH0cuHhFnnv_USHrXvjmwY9+Fw_KEuqhQjecU_-bAtQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Craig James <cjames@emolecules.com> writes:
> Hmmm.... the subselect is invalid, but not rejected. The outer select
> returns every row in the customer_order_matches table. This seems pretty
> wrong. This is PG 9.2.1 running on Ubuntu.
> db=> select count(1) from customer_order_matches where
> customer_order_item_id in (select customer_order_item_id from
> customer_order where customer_order_id = 105862140);
> count
> -------
> 36180
> (1 row)
Unfortunately, if customer_order_item_id doesn't exist in
customer_order, that's still a perfectly valid outer reference
to customer_order_matches.customer_order_item_id. People get
confused by that kind of thing regularly, but it's required by
spec to work like this.
regards, tom lane
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, cjames@emolecules.com
Subject: Re: Invalid SQL not rejected?
In-Reply-To: <29413.1365727483@sss.pgh.pa.us>
* 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