X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4ED80D8D21 for ; Thu, 15 Sep 2005 10:56:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33687-05 for ; Thu, 15 Sep 2005 13:55:58 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 58472D86B2 for ; Thu, 15 Sep 2005 10:55:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j8FDu1w7013507; Thu, 15 Sep 2005 09:56:01 -0400 (EDT) To: n.j.saunders@gmail.com Cc: pgsql-sql@postgresql.org Subject: Re: Triggers & Conditional Assignment In-reply-to: References: Comments: In-reply-to Neil Saunders message dated "Thu, 15 Sep 2005 10:25:19 +0100" Date: Thu, 15 Sep 2005 09:56:01 -0400 Message-ID: <13506.1126792561@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/159 X-Sequence-Number: 22706 Neil Saunders writes: > I've tried to write something along the lines of the following: > sdate = (NEW.start_date IS NOT NULL) ? NEW.start_date : OLD.start_date; > edate = (NEW.end_date IS NOT NULL) ? NEW.end_date : OLD.end_date; > But conditional assignment doesn't seem to be catered for. The equivalent construct in SQL is CASE. regards, tom lane