Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e6SFDYB86116 for ; Fri, 28 Jul 2000 11:13:35 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id LAA29741; Fri, 28 Jul 2000 11:13:31 -0400 (EDT) To: "=?iso-8859-1?B?QW5kcukgTuZzcw==?=" cc: pgsql-sql@postgresql.org Subject: Re: Conditional rule? In-reply-to: <013001bff889$86051030$74b5f8c2@wkst6> References: <87k8e78yg9.fsf@matt.w80.math-hat.com> <003601bff7d9$18cdd610$74b5f8c2@wkst6> <00072715035004.09700@comptechnews> <00072715082905.09700@comptechnews> <013001bff889$86051030$74b5f8c2@wkst6> Comments: In-reply-to "=?iso-8859-1?B?QW5kcukgTuZzcw==?=" message dated "Fri, 28 Jul 2000 13:46:51 +0200" Date: Fri, 28 Jul 2000 11:13:31 -0400 Message-ID: <29738.964797211@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/273 "=?iso-8859-1?B?QW5kcukgTuZzcw==?=" writes: > Secondly, I miss one final idea, when a delete is performed on the > b_news_unpublished table, I would like to set up a rule or procedure that > sets the time value to null in b_news for each row that is affected by the > delete. I understand that the OLD and NEW objects are accessible only during > UPDATE or INSERT operations, so I can't quite see how to do this... I might be wrong, but I thought the way it works is: INSERT: "NEW" refers to to-be-inserted row UPDATE: "OLD" is old row state, "NEW" is planned new row state DELETE: "OLD" holds row to be deleted regards, tom lane