pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: josh@agliodbs.com
Cc: Michael Paesold <mpaesold@gmx.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: Assignments in PL/pgSQL
Date: Fri, 13 Sep 2002 14:04:35 -0400
Message-ID: <3D8228B3.6262C2C7@Yahoo.com> (raw)
References: <GNELIHDDFBOCMGBFGEFOMEDICEAA.chriskl@familyhealth.com.au>
	<007301c25b12$5b8d96e0$4201a8c0@beeblebrox>
	<200209131051.41556.josh@agliodbs.com>

Josh Berkus wrote:
> 
> 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?

Er ... I don't recall completely, maybe it was more compatibility
to my own lazyness ;-/ (typing a colon means Shift-and-semicolon
... that's 2 saved keystrokes per assignment ... what do you
think where I save all the keystrokes I need to write email like
this?).

Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being
right. #
# Let's break this rule - forgive
me.                                  #
#==================================================
JanWieck@Yahoo.com #



view thread (5+ messages)  latest in thread

Message-ID: <3D8228B3.6262C2C7@Yahoo.com>
Permalink:  ../3D8228B3.6262C2C7@Yahoo.com/
Also on:    postgresql.org/message-id/3D8228B3.6262C2C7@Yahoo.com

 · 

reply

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: JanWieck@Yahoo.com, josh@agliodbs.com, mpaesold@gmx.at
  Subject: Re: Assignments in PL/pgSQL
  In-Reply-To: <3D8228B3.6262C2C7@Yahoo.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