Search Postgresql Archives

Re: SELECT my_table.varchar FROM my_table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Broersma <richard.broersma@xxxxxxxxx> writes:
> On Mon, May 31, 2010 at 7:48 AM, Jan Strube <js@xxxxxxxxx> wrote:
>> I accidentally encountered a feature in Postgres 8.3 that I couldn't find in
>> the documentation while submitting a query like
>> 
>> SELECT my_table.varchar FROM my_table
>> 
>> which returns a concatenated string of all field values per row.
>> I wonder where this is documented (and if it has something to do with
>> composite types).
>> 
>> Can anyone please explain?

> I don't really know, but the result looks more like a single field

It's equivalent to (my_table.*)::varchar.  We've seen enough people
confused by this (or the equivalent cases with text and name as
the target type) that I wonder if we should intentionally break the
symmetry and disable treating this case as a cast.  Although I do
rather wonder what the OP expected to happen here.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux