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

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>,<pgsql-bugs(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jon Nelson" <jnelson+pgsql(at)jamponi(dot)net>
Subject: Re: [PERFORM] typoed column name, but postgres didn't grump
Date: 2010-10-29 19:46:28
Message-ID: 4CCADE440200002500036FB2@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-performance

Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

>> 2. The notation t(x) will be taken to mean x::t if there's no
>> function t() taking x's type, but there is a cast from x's type
>> to t.

>> I think if I had to pick a proposal, I'd say we should disable #2
>> for the specific case of casting a composite type to something
>> else.

> Well, then let's do that. It's not the exact fix I'd pick, but
> it's clearly better than nothing, so I'm willing to sign on to it
> as a compromise position.

It seems a bad idea to have so many different syntaxes for identical
CAST semantics, but there they are, and it's bad to break things.
One of the reasons #2 seems like the place to fix it is that it's
pretty flaky anyway -- "it will be taken to mean x unless there no y
but there is a z" is pretty fragile to start with. Adding one more
condition to the places it kicks in doesn't seem as good to me as
dropping it entirely, but then I don't have any code which depends
on type(value) as a cast syntax -- those who do will likely feel
differently.

So, I'd rather scrap #2 entirely; but if that really would break
much working code, +1 for ignoring it when it would cast a composite
to something else.

-Kevin

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-10-29 20:05:32 Re: What happened to SSL_CIPHERS?
Previous Message Robert Haas 2010-10-29 19:15:02 Re: [PERFORM] typoed column name, but postgres didn't grump

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2010-10-29 20:12:42 Re: [PERFORM] typoed column name, but postgres didn't grump
Previous Message Robert Haas 2010-10-29 19:15:02 Re: [PERFORM] typoed column name, but postgres didn't grump