Re: Strange behavior of "=" as assignment operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange behavior of "=" as assignment operator
Date: 2013-06-01 14:53:44
Message-ID: 20955.1370098424@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Johnston <polobo(at)yahoo(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-06-01 16:17:16 Re: Insert with query
Previous Message David Johnston 2013-06-01 14:42:26 Re: Sum raw with the same continuous flags