Assignments in PL/pgSQL

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Assignments in PL/pgSQL
Date: 2002-09-13 10:43:10
Message-ID: 007301c25b12$5b8d96e0$4201a8c0@beeblebrox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Hanno Wiegard 2002-09-13 12:10:25 Table alias in DELETE statements
Previous Message Albrecht Berger 2002-09-13 10:39:46 Re: sql group by statement