Re: What is the name pseudo column

From: David Fetter <david(at)fetter(dot)org>
To: Jack Christensen <jackc(at)hylesanderson(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is the name pseudo column
Date: 2010-12-15 21:27:19
Message-ID: 20101215212719.GB29351@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 15, 2010 at 01:50:54PM -0600, Jack Christensen wrote:
> I was just surprised when accidentally selecting a non-existent name
> column there was no error -- instead something came back.
>
> select accounts.name from accounts limit 1 ->
> (1,65522,1,0.00,,"2010-07-22 09:57:26.281172-05",2)
>
> It appears it tries to return the entire row in an array (but longer
> rows get truncated).
>
> I've searched Google and the PG docs but I haven't had any luck.

What happened here is that you ran into PostgreSQL's "charming" habit
of using the argument.function notation, so you called the "name"
function, i.e. the one that casts to name, on the entire row from your
accounts table.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2010-12-15 22:49:46 Re: How to restore from backup to 8.4.3 server using 9.0 dump/restore
Previous Message Radosław Smogura 2010-12-15 21:19:55 Re: Changing table owner to db owner.