Re: INSERT a number in a column based on other columns OLD INSERTs

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Adrian Klaver *EXTERN*'" <adrian(dot)klaver(at)aklaver(dot)com>, "Charles Clavadetscher" <clavadetscher(at)swisspug(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: INSERT a number in a column based on other columns OLD INSERTs
Date: 2015-06-22 08:00:40
Message-ID: A737B7A37273E048B164557ADEF4A58B50F66F54@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver wrote:
> On 06/20/2015 12:41 PM, Charles Clavadetscher wrote:
>> I just made a short test with the code provided. As Bill mentioned the
>> moment when the trigger is fired is essential.
>> I made a test with both before (worked) and after (did not work because
>> the row was already inserted and the returned new row is ignored).
>>
>> The assignment (= or :=) does not seem to play a role, but the correct
>> version is as mentioned :=
>
> Yea, I can't seem to remember this part of the docs:
>
> " Equal (=) can be used instead of PL/SQL-compliant :=."

This was discussed on -hackers a while ago:
http://www.postgresql.org/message-id/flat/52EF20B2E3209443BC37736D00C3C1380876BDC7(at)EXADV1(dot)host(dot)magwien(dot)gv(dot)at#52EF20B2E3209443BC37736D00C3C1380876BDC7@EXADV1.host.magwien.gv.at

It's a rather long and rambling thread, but what I got from it
was that "=" for assignments is something that just works by accident,
is discouraged and left alive only to avoid breaking code that uses it.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2015-06-22 08:04:20 Re: Postgresql 9.2 has standby server lost data?
Previous Message Adrian Klaver 2015-06-22 00:12:42 Re: INSERT a number in a column based on other columns OLD INSERTs