Re: BUG #5360: system column named "text"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sergey Manakov" <vialorn(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5360: system column named "text"
Date: 2010-03-03 18:50:38
Message-ID: 14690.1267642238@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Sergey Manakov" <vialorn(at)gmail(dot)com> writes:
> I have some table with column named "remark" and without column named
> "text". I wrote SQL where try to select column named "text" by mistake:

> SELECT st.text
> FROM sometable st

> Where error expected, but query executed without error! Query result is one
> column contains text representation of ROWs.

> Is this a bug, or I'am look for description in docs badly?

No, it's not a bug. It's equivalent to text(st) or st::text, that
is the system thinks you're requesting a coercion of the rowtype
value to text. The syntactic equivalence of f(foo) and foo.f is
documented near the end of section 34.4.2:
http://www.postgresql.org/docs/8.4/static/xfunc-sql.html#AEN43797

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-03-03 18:53:58 Re: Bug in triggers
Previous Message Sergey Manakov 2010-03-03 16:48:07 BUG #5360: system column named "text"