Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EECC7476AAD for ; Fri, 13 Sep 2002 14:07:43 -0400 (EDT) Received: from smtp015.mail.yahoo.com (smtp015.mail.yahoo.com [216.136.173.59]) by postgresql.org (Postfix) with SMTP id 3D0C24763E0 for ; Fri, 13 Sep 2002 14:07:43 -0400 (EDT) Received: from psc.progress.com (HELO Yahoo.com) (janwieck@192.233.92.200 with plain) by smtp.mail.vip.sc5.yahoo.com with SMTP; 13 Sep 2002 18:07:40 -0000 Message-ID: <3D8228B3.6262C2C7@Yahoo.com> Date: Fri, 13 Sep 2002 14:04:35 -0400 From: Jan Wieck Organization: Home X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,ru MIME-Version: 1.0 To: josh@agliodbs.com Cc: Michael Paesold , pgsql-sql@postgresql.org Subject: Re: Assignments in PL/pgSQL References: <007301c25b12$5b8d96e0$4201a8c0@beeblebrox> <200209131051.41556.josh@agliodbs.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/142 X-Sequence-Number: 9419 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 #