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

Re: typoed column name, but postgres didn't grump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: typoed column name, but postgres didn't grump
Date: 2010-10-29 17:48:18
Message-ID: 4480.1288374498@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-performance
Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> writes:
> 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'.

This is the old automatic-cast-from-record-to-text-string issue,
ie it treats this like "(t2.*)::name".

We've been over this a few times before, but it's not clear that
we can make this throw an error without introducing unpleasant
asymmetry into the casting behavior, as in you couldn't get the
cast when you did want it.

BTW this seems pretty far off-topic for pgsql-performance.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Robert HaasDate: 2010-10-29 18:13:31
Subject: Fwd: failure notice
Previous:From: Kevin GrittnerDate: 2010-10-29 17:18:20
Subject: Re: MVCC and Implications for (Near) Real-Time Application

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-10-29 17:56:23
Subject: Re: What happened to SSL_CIPHERS?
Previous:From: Magnus HaganderDate: 2010-10-29 17:39:04
Subject: Re: What happened to SSL_CIPHERS?

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