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

From Steve Crawford
Subject Re: Strange behavior of "=" as assignment operator
Date
Msg-id 51A5123E.7090202@pinpointresearch.com
Whole thread Raw
In response to Re: Strange behavior of "=" as assignment operator  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Strange behavior of "=" as assignment operator
List pgsql-general
On 05/28/2013 01:06 PM, Stephen Frost wrote:
> * Moshe Jacobson (moshe@neadwerx.com) wrote:
>> It seems that the comparison operator "=" is functioning as the assignment
>> operator ":=" in this plpgsql trigger script I wrote. I was under the
>> impression that "=" is only for comparison and not assignment. If this is
>> true, please explain the transcript below. If it's not true, where is this
>> documented? I'm using PostgreSQL 9.1.4.
> Both are supported.  It's not really documented as using '=' is
> considered 'legacy' but it's also extensively used and removing it would
> break quite a bit of code for people.
>
>

You mean legacy code as provided in the documentation examples?
http://www.postgresql.org/docs/9.3/static/plpgsql-trigger.html (see
examples 39-5 and 39-6).

Fixing the example code is probably a low-hanging-fruit place to start.
I don't have time right now or I'd submit a patch.

Cheers,
Steve


pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Strange behavior of "=" as assignment operator
Next
From: Pavel Stehule
Date:
Subject: Re: Strange behavior of "=" as assignment operator