Re: No error when column doesn't exist - Mailing list pgsql-general

From Tom Lane
Subject Re: No error when column doesn't exist
Date
Msg-id 15859.1221132273@sss.pgh.pa.us
Whole thread Raw
In response to Re: No error when column doesn't exist  (Dean Rasheed <dean_rasheed@hotmail.com>)
Responses Re: No error when column doesn't exist  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Dean Rasheed <dean_rasheed@hotmail.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

pgsql-general by date:

Previous
From: Harald Fuchs
Date:
Subject: Re: psql scripting tutorials
Next
From: Joao Ferreira gmail
Date:
Subject: about partitioning