From: Josh Berkus <josh@agliodbs.com>
To: Michael Paesold <mpaesold@gmx.at>
To: pgsql-sql@postgresql.org
Subject: Re: Assignments in PL/pgSQL
Date: Fri, 13 Sep 2002 10:51:41 -0700
Message-ID: <200209131051.41556.josh@agliodbs.com> (raw)
In-Reply-To: <007301c25b12$5b8d96e0$4201a8c0@beeblebrox>
References: <GNELIHDDFBOCMGBFGEFOMEDICEAA.chriskl@familyhealth.com.au>
<007301c25b12$5b8d96e0$4201a8c0@beeblebrox>
Michael,
> although this is not really SQL, but PL/pgSQL, I hope this is the right
> place to ask.
This is the right place.
> 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?
I'm very surprised, too. The "=" syntax is not per spec; my guess is,
somebody coded in compatibility for DB conversion purposes and left it there.
Jan? Tom?
--
-Josh Berkus
Aglio Database Solutions
San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, mpaesold@gmx.at
Subject: Re: Assignments in PL/pgSQL
In-Reply-To: <200209131051.41556.josh@agliodbs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox