Max Speransky said:
> Hello
>
> My task is to validate expression and get value of it in boolean variable.
[snip]
> when I try to execute this function I get such result:
>
> bill=# select get_value(3);
> WARNING: Error occurred while executing PL/pgSQL function get_value
> WARNING: line 6 at assignment
> ERROR: Bad boolean external representation '3=3'
|| is the string concatenation operator - so your expression creates a
string "3=3" and then tries to return that as a boolean hence the error.
if you cannot just do "return 3 = $1;" perhaps you could try using EXECUTE?
cheers
Martin