Invalid SQL not rejected?

From: Craig James <cjames(at)emolecules(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Invalid SQL not rejected?
Date: 2013-04-12 00:17:29
Message-ID: CAFwQ8reYH0cuHhFnnv_USHrXvjmwY9+Fw_KEuqhQjecU_-bAtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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)

db=> select customer_order_item_id from customer_order where
customer_order_id = 105862140;
ERROR: column "customer_order_item_id" does not exist
LINE 1: select customer_order_item_id from customer_order where cust...
^

Craig

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2013-04-12 00:44:43 Re: Invalid SQL not rejected?
Previous Message Tom Lane 2013-04-11 23:59:14 Re: after 9.2.4 patch vacuumdb -avz not analyzing all tables