Re: Strange behavior of "=" as assignment operator

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Moshe Jacobson <moshe(at)neadwerx(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>, Stephen Dolan <stephen(at)neadwerx(dot)com>
Subject: Re: Strange behavior of "=" as assignment operator
Date: 2013-05-28 20:28:05
Message-ID: CAFj8pRDHO1SoF9sp28CPUDu=A5vsH51C1PDMVo6hpfXBFQxUKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2013/5/28 Steve Crawford <scrawford(at)pinpointresearch(dot)com>:
> On 05/28/2013 01:06 PM, Stephen Frost wrote:
>>
>> * Moshe Jacobson (moshe(at)neadwerx(dot)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.

this is bug and should be fixed. I''ll send a patch.

Pavel

>
> Cheers,
> Steve
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dimitar Misev 2013-05-28 21:53:38 BLOB updates -> database size explodes
Previous Message Pavel Stehule 2013-05-28 20:27:11 Re: Strange behavior of "=" as assignment operator