why table.name is translated to (name.*)::name?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: why table.name is translated to (name.*)::name?
Date: 2010-03-30 13:41:58
Message-ID: 162867791003300641h71e033d5n67d341c0aacf6ef7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I was noticed on little bit strange feature of PostgreSQL 8.4 and 9.0

we can use a non existing column "name". What does mean?

postgres=# create table h(a int, b int);
CREATE TABLE
Time: 2,604 ms
postgres=# insert into h values(199,22);
INSERT 0 1
Time: 0,970 ms
postgres=# explain verbose select h.name from h;
QUERY PLAN
-------------------------------------------------------------
Seq Scan on public.h (cost=0.00..42.10 rows=2140 width=32)
Output: (h.*)::name
(2 rows)

Time: 0,727 ms
postgres=# select h.name from h;
name
----------
(199,22)
(1 row)

Time: 0,589 ms
postgres=#

Regards
Pavel Stehule

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-03-30 13:51:21 Re: Questions about 9.0 release note
Previous Message Dimitri Fontaine 2010-03-30 13:36:25 Re: GSoC