Re: SQL function parse error ? - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: SQL function parse error ?
Date
Msg-id 3E1D6362.80701@klaster.net
Whole thread Raw
In response to SQL function parse error ?  ("Radu-Adrian Popescu" <radu.popescu@aldratech.com>)
List pgsql-sql
Radu-Adrian Popescu wrote:

>
> Take the following for example:
> create or replace function testfunc1(int) returns setof test as
> '
>     select * from test where age>$1;
> '                            ^^^^^^
> language sql;

I didn't find it in documentation, but sql functions are like bash (you 
forgot about space character):

create or replace function testfunc1(int) returns setof test as
'    select * from test where age > $1;
'
works fine.
Postgresql thinks that >$ is an operator instead of >

Tomasz Myrta



pgsql-sql by date:

Previous
From: "Radu-Adrian Popescu"
Date:
Subject: SQL function parse error ?
Next
From: "Radu-Adrian Popescu"
Date:
Subject: Re: SQL function parse error ?