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

From: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
To:
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [PERFORM] typoed column name, but postgres didn't grump
Date: 2010-11-02 22:17:00
Message-ID: AANLkTikS1ne-VdEwKNp1FqWNhxF=84cXrL1P_zJYaie=@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-performance

On Tue, Nov 2, 2010 at 4:34 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> Jon Nelson <jnelson+pgsql(at)jamponi(dot)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".  Kind of.  It won't show up in the display 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!

--
Jon

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tian Shiquan 2010-11-03 06:40:49 BUG #5742: cannot alter column
Previous Message Dimitri Fontaine 2010-11-02 22:09:37 Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2010-11-02 22:30:08 Re: A query become very slow after upgrade from 8.1.10 to 8.4.5
Previous Message Kevin Grittner 2010-11-02 21:34:25 Re: [PERFORM] typoed column name, but postgres didn't grump