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

typoed column name, but postgres didn't grump

From: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: typoed column name, but postgres didn't grump
Date: 2010-10-29 16:40:24
Message-ID: AANLkTimYMA8D2h4-jHK5vD032jWwig1iJmW6uF-3i=Bx@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-performance
I've been having trouble with a query.
The query is a cross join between two tables.
Initially, I mis-typed the query, and one of the columns specified in
the query doesn't exist, however the query ran nonetheless.

The actual query:
select gid from t2, t3 where t2.name = t3.name and t3.scope = 'city'
and t3.hierarchy = 'STANDARD' and t2.adiv = t3.adiv limit 1 ;
However, there *is* no column 'name' in table 't2'.
When I ran the query, it took a *really* long time to run (670 seconds).
When I corrected the query to use the right column name (city_name),
the query ran in 28ms.

The question, then, is why didn't the postgres grump about the
non-existent column name?

The version is 8.4.5 on x86_64, openSUSE 11.3

 PostgreSQL 8.4.5 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292], 64-bit


-- 
Jon

Responses

pgsql-performance by date

Next:From: Robert HaasDate: 2010-10-29 16:44:06
Subject: Re: BBU Cache vs. spindles
Previous:From: Igor NeymanDate: 2010-10-29 16:28:20
Subject: Re: partitioning question 1

pgsql-bugs by date

Next:From: Josh BerkusDate: 2010-10-29 17:01:58
Subject: Re: What happened to SSL_CIPHERS?
Previous:From: Robert HaasDate: 2010-10-29 16:23:39
Subject: Re: BUG #5707: Cross compilation for windows is broken

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