Re: Strange behavior of "=" as assignment operator - Mailing list pgsql-general

From Tom Lane
Subject Re: Strange behavior of "=" as assignment operator
Date
Msg-id 20955.1370098424@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strange behavior of "=" as assignment operator  (David Johnston <polobo@yahoo.com>)
Responses Re: Strange behavior of "=" as assignment operator
List pgsql-general
David Johnston <polobo@yahoo.com> writes:
> A bogus warning is nearly as bad as simply disallowing the syntax in the
> first place and I do not like turning one on unless there is the decision to
> disallow the syntax in the future.

TBH I do not see this happening.  GET DIAGNOSTICS is just the tip of the
iceberg.  The SQL standard uses "=" for assignment in other contexts,
most notably UPDATE, but also the SQL/PSM standard uses it in
<assignment statement> which is the exact same thing as in pl/pgsql.
So while purists might wish we only accepted :=, doing so would be
inconsistent with SQL.

I think we should just document it and move on.

            regards, tom lane


pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Sum raw with the same continuous flags
Next
From: Adrian Klaver
Date:
Subject: Re: Insert with query