X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A413BD1B17A for ; Thu, 13 May 2004 11:50:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 23223-06 for ; Thu, 13 May 2004 11:50:13 -0300 (ADT) Received: from ucsns.ucs.co.za (ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0DC54D1B173 for ; Thu, 13 May 2004 11:50:08 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by ucsns.ucs.co.za (Postfix) with ESMTP id 7164A2BDB1 for ; Thu, 13 May 2004 16:50:02 +0200 (SAST) Received: from ucsns.ucs.co.za ([127.0.0.1]) by localhost (ucsns.ucs.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24947-07 for ; Thu, 13 May 2004 16:49:37 +0200 (SAST) Received: from ucspost.ucs.co.za (mailgw1.ucs.co.za [196.23.43.253]) by ucsns.ucs.co.za (Postfix) with ESMTP id 980482BDBC for ; Thu, 13 May 2004 16:49:37 +0200 (SAST) Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.3]) by ucspost.ucs.co.za (Postfix) with ESMTP id ADE0DDAC97 for ; Thu, 13 May 2004 16:49:36 +0200 (SAST) Received: from svb.ucs.co.za (svb.ucs.co.za [172.31.1.148]) by jhb.ucs.co.za (Postfix) with SMTP id BDB5997642 for ; Thu, 13 May 2004 16:49:36 +0200 (SAST) Date: Thu, 13 May 2004 16:49:36 +0200 From: Stef To: pgsql-sql@postgresql.org Subject: Re: Exceptions when 0 rows affected. Message-Id: <20040513164936.6fad8cc5@svb.ucs.co.za> X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-pc-linux-gnu) User-Agent: sillypheed-claws (anti-aliased) X-Face: GFoC95e6r)_TTG>n~=uFLojP=O~4W@Ms]>:.DMm/')(z3\Mwj^XP@? Q:3";lD.OM1"^mDu}2NJ@US:)dO:U*iY5EM50&Tx. X-Operating-System: sid X-X-X: _-^-_ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at ucs.co.za X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/121 X-Sequence-Number: 17835 Andrei Bintintan mentioned : => Your problem depends on what interface/programming language you're using. Yep, I tried to do it using rules or triggers, but I can't get it to do what I want exactly, and it's not a good idea to put any rules or triggers on my database. I'm sticking to psql though, and managed to create the query with a nested nullif and coalesce to make my query fail if there are 0 rows matching for an update or delete. Cheers Stef