Assignments in PL/pgSQL - Mailing list pgsql-sql

From Michael Paesold
Subject Assignments in PL/pgSQL
Date
Msg-id 007301c25b12$5b8d96e0$4201a8c0@beeblebrox
Whole thread Raw
In response to Re: DISTINCT ON  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: Assignments in PL/pgSQL  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
Hi all,

although this is not really SQL, but PL/pgSQL, I hope this is the right
place to ask.

I have written a complex triggers. It works very well. Just now I have
realized that I have used the = operater for variable assignments, instead
of the := operater. To my suprise, there was no error or warning, and the
store procedure works very well!

e.g.
NEW.someval = rec.someother;
works as well as
NEW.someval := rec.someother;

Can you confirm that both are valid? Can someone explain this?
And is it safe to use the former syntax?

Best Regards,
Michael Paesold





pgsql-sql by date:

Previous
From: "Albrecht Berger"
Date:
Subject: Re: sql group by statement
Next
From: Hanno Wiegard
Date:
Subject: Table alias in DELETE statements