Re: select t.name from tbl t (where "name" is not a column name)

From: Joe Conway <mail(at)joeconway(dot)com>
To: Igor Neyman <ineyman(at)perceptron(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select t.name from tbl t (where "name" is not a column name)
Date: 2010-02-24 17:49:17
Message-ID: 4B85669D.5000907@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/24/2010 07:16 AM, Igor Neyman wrote:
> Joe,
>
> What PG version are running?
>
> 8.2 here complains when running your example:
>
> ERROR: column foo.name does not exist
> LINE 6: select foo.name from foo;
> ^
>
> ********** Error **********
>
> ERROR: column foo.name does not exist
> SQL state: 42703

Prior to 8.3 you aren't able to cast a rowtype as text or name datatype,
so no matching function is found.

-------------
in 8.3.x
-------------
contrib_regression=# select text(foo) from foo;
text
------
(-1)
(1 row)

-------------
in 8.2.x
-------------
contrib_regression=# select text(foo) from foo;
ERROR: function text(foo) does not exist
LINE 1: select text(foo) from foo;
^
HINT: No function matches the given name and argument types. You may
need to add explicit type casts.

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Figueiredo Jr. 2010-02-24 17:57:17 Re: Npgsql connection string editor?
Previous Message Ivan Sergio Borgonovo 2010-02-24 17:41:53 C function manipulating tsquery doesn't work with -O2