Re: [SQL] Anyone recognise this error from PL/pgSQL? - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] Anyone recognise this error from PL/pgSQL?
Date
Msg-id 1611.934824902@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] Anyone recognise this error from PL/pgSQL?  (Stuart Rison <stuart@ludwig.ucl.ac.uk>)
Responses Re: [SQL] Anyone recognise this error from PL/pgSQL?
List pgsql-sql
Stuart Rison <stuart@ludwig.ucl.ac.uk> writes:
> CREATE FUNCTION test(int2) RETURNS int2 AS '
> SELECT field2 FROM test
>     WHERE field1=$1;
> ' language 'sql';
> ERROR:  There is no operator '=$' for types 'int2' and 'int4'

That case is ambiguous: is it field1 =$ 1 or field1 = $1 ?  ("=$" is a
legal operator name according to Postgres.)  So I don't have a problem
with disallowing that.  But field1=NEW is not ambiguous under the
Postgres lexical rules, and plpgsql shouldn't be creating an
ambiguity...
        regards, tom lane


pgsql-sql by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [SQL] Anyone recognise this error from PL/pgSQL?
Next
From: Stuart Rison
Date:
Subject: Re: [SQL] Anyone recognise this error from PL/pgSQL?