Hello !
There is a strange behaviour in the SQL function
parser (haven't tested this with the plpgsql lang) when using standard
operators
and function parameters.
Take the following for example:
create or replace function
testfunc1(int) returns setof test as
' select * from test where age>$1; ' language sql;
This yealds the
following error, which frankly is kind of too
much :
ERROR: Unable to identify
an operator '>$' for types 'integer' and 'integer'
I strongly belive the parser is a bit keen on
interpreting the >$ sequence as an operator. Take for instance php, where all
variables start with $; " 100>$foo "
is quite valid !
The error goes away of course when rewriting it as
" age > $1".
I'm afraid that taking whitespace into
consideration when parsing a language is not the way to do it, except when it's
python, of course :)
Hope this, helps,
Regards,
===== Radu-Adrian Popescu CSA, DBA, Developer Aldratech Ltd. |
- Re: [SQL] SQL function parse error ? Radu-Adrian Popescu
- Re: [SQL] SQL function parse error ? Tomasz Myrta
- Re: [SQL] SQL function parse error ? Radu-Adrian Popescu
- Re: [SQL] SQL function parse error ? Tomasz Myrta
- Re: [SQL] SQL function parse error ? Radu-Adrian Popescu
- Re: [SQL] SQL function parse err... Achilleus Mantzios
- Re: [SQL] SQL function parse... Radu-Adrian Popescu
- Re: [SQL] SQL function p... Stephan Szabo
- Re: [SQL] SQL function parse... Tom Lane
- Re: [SQL] SQL function p... Radu-Adrian Popescu
- Re: [SQL] SQL function p... Robert Treat