From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jon Nelson <jnelson+pgsql@jamponi.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: typoed column name, but postgres didn't grump
Date: Fri, 29 Oct 2010 13:48:18 -0400
Message-ID: <4480.1288374498@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTimYMA8D2h4-jHK5vD032jWwig1iJmW6uF-3i=Bx@mail.gmail.com>
References: <AANLkTimYMA8D2h4-jHK5vD032jWwig1iJmW6uF-3i=Bx@mail.gmail.com>
Jon Nelson <jnelson+pgsql@jamponi.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
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-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, jnelson+pgsql@jamponi.net
Subject: Re: typoed column name, but postgres didn't grump
In-Reply-To: <4480.1288374498@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