Skip site navigation (1) Skip section navigation (2)

Re: No error when FROM is missing in subquery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mike <mike(at)thegodshalls(dot)com>
Cc: "Thomas H(dot)" <me(at)alternize(dot)com>, Jaime Casanova <systemguards(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: No error when FROM is missing in subquery
Date: 2006-12-19 05:48:22
Message-ID: 15735.1166507302@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
mike <mike(at)thegodshalls(dot)com> writes:
> Pgsql does not throw an error (at least prior to 8.2) if the column
> referenced by the select statement for the IN clause does not exist.

My, there's a lot of misinformation in this thread.

The reason there's no error thrown is that the reference to mov_id in
the sub-SELECT is a perfectly legal outer reference to the mov_id column
available from the upper SELECT.  If the column truly did not exist
anywhere in the tables used in the query, it would have thrown an error.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Ned T. CriglerDate: 2006-12-19 05:59:50
Subject: BUG #2840: \set HISTCONTROL ignoredups doesn't work in psql
Previous:From: mikeDate: 2006-12-19 05:40:18
Subject: Re: No error when FROM is missing in subquery

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group