Re: [PERFORM] typoed column name, but postgres didn't grump - Mailing list pgsql-bugs

From Jon Nelson
Subject Re: [PERFORM] typoed column name, but postgres didn't grump
Date
Msg-id AANLkTikS1ne-VdEwKNp1FqWNhxF=84cXrL1P_zJYaie=@mail.gmail.com
Whole thread Raw
In response to Re: [PERFORM] typoed column name, but postgres didn't grump  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
On Tue, Nov 2, 2010 at 4:34 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Jon Nelson <jnelson+pgsql@jamponi.net> wrote:
>
>> If I saw this behavior ( a.b also meaning b(a) ) in another SQL
>> engine, I would consider it a thoroughly unintuitive wart
>
> I think the main reason it has been kept is the converse -- if you
> define a function "b" which takes record "a" as its only parameter,
> you have effectively created a "generated column" on any relation
> using record type "a". =C2=A0Kind of. =C2=A0It won't show up in the displ=
ay of
> the relation's structure or in a SELECT *, and you can't use it in
> an unqualified reference; but you can use a.b to reference it, which
> can be convenient.

Aha. I think I understand, now. I also read up on CAST behavior
changes between 8.1 and 8.4 (what I'm using), and I found section
34.4.2  "SQL Functions on Composite Types" quite useful.

Thanks!

--=20
Jon

pgsql-bugs by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.
Next
From: "Tian Shiquan"
Date:
Subject: BUG #5742: cannot alter column