Re: No error when column doesn't exist

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean_rasheed(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: No error when column doesn't exist
Date: 2008-09-11 11:24:33
Message-ID: 15859.1221132273@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dean Rasheed <dean_rasheed(at)hotmail(dot)com> writes:
>> foo.char and foo.varchar have similarly unexpected behavior; I think
>> that's probably the end of it, though, since those are the only types
>> that CoerceViaIO will take as targets.

> ... and also any user defined domains based on those, which is
> what I actually had.

Ouch. That makes the scope for unexpected behavior wider than I thought.
Maybe we do need some restriction here?

The ideas I had involved not considering the cast interpretation when
the actual syntax is table.column and some-set-of-other-conditions.
While this is certainly possible to implement, any variant of it will
break the existing 100% equivalence of foo.bar and bar(foo); which
seems to me to be a nice principle, though I grant you won't find it
anywhere in the SQL standard.

The other-conditions are a bit up for grabs. The narrowest restriction
that would serve the purpose is "table variable is of composite type
and the cast would be a CoerceViaIO cast", but that definitely seems
like a wart. However, cleaner-seeming restrictions like "no casts on
composites at all" could potentially break applications that worked
okay before 8.3.

Comments anyone? Should we try to change this, or leave well enough
alone?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joao Ferreira gmail 2008-09-11 11:47:00 about partitioning
Previous Message Harald Fuchs 2008-09-11 11:13:51 Re: psql scripting tutorials