Thread: ...

...

From
owner
Date:
i've CREATE FUNCTION iv_get(int) RETURNS SETOF same_table AS ' select *
from same_table; ' LANGUAGE SQL;

and then

medyk=# SELECT * FROM iv_get(0);
ERROR:  parser: parse error at or near "("

 why ?? is there somethink bad
?? same_table of course exists, but why i've this error ? its a bug ??

or is some other way to select somethink throught function , my function
??

Re:

From
Stephan Szabo
Date:
On Sat, 28 Dec 2002, owner wrote:

>
> i've CREATE FUNCTION iv_get(int) RETURNS SETOF same_table AS ' select *
> from same_table; ' LANGUAGE SQL;
>
> and then
>
> medyk=# SELECT * FROM iv_get(0);
> ERROR:  parser: parse error at or near "("
>
>  why ?? is there somethink bad
> ?? same_table of course exists, but why i've this error ? its a bug ??

My guess is that you're not running a version prior to 7.3.

Re:

From
Tom Lane
Date:
owner <ivan@psycho.pl> writes:
> i've CREATE FUNCTION iv_get(int) RETURNS SETOF same_table AS ' select *
> from same_table; ' LANGUAGE SQL;
> and then
> medyk=# SELECT * FROM iv_get(0);
> ERROR:  parser: parse error at or near "("

Works for me.  I suspect you are trying to use 7.3 features with a
pre-7.3 Postgres installation.

            regards, tom lane