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 31D97D1F13B for ; Mon, 10 May 2004 10:10:02 -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 67120-06 for ; Mon, 10 May 2004 10:09:43 -0300 (ADT) Received: from ucsns.ucs.co.za (ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6D539D1F0DF for ; Mon, 10 May 2004 10:09:27 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by ucsns.ucs.co.za (Postfix) with ESMTP id 8DB792BD7C for ; Mon, 10 May 2004 15:09:18 +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 12372-02 for ; Mon, 10 May 2004 15:08:49 +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 5A84B2BE1E for ; Mon, 10 May 2004 15:08:12 +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 1024CD9E41 for ; Mon, 10 May 2004 15:08:12 +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 A83B9975A0 for ; Mon, 10 May 2004 15:08:12 +0200 (SAST) Date: Mon, 10 May 2004 15:08:08 +0200 From: Stef To: pgsql-sql@postgresql.org Subject: Exceptions when 0 rows affected. Message-Id: <20040510150808.7ea12c06@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: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Mon__10_May_2004_15_08_08_+0200_1Iif0.Qqhp.i8buy" 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/86 X-Sequence-Number: 17800 --Signature=_Mon__10_May_2004_15_08_08_+0200_1Iif0.Qqhp.i8buy Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit Hi all, I've been looking on Google,the archives and documentation, but cannot find what I'm looking for. Maybe I've read the answer, but it's still evading me. I'm working with postgres 7.3.4 using the psql client. I want to know if it's possible to raise an error in a transactional BEGIN->END block when e.g. an update or delete statement affects zero rows. I want the entire transaction block to rollback when this happens. I can do it in perl and java , but would in this instance like to load a file with SQL statements using psql -f . Is it possible? Kind Regards Stefan --Signature=_Mon__10_May_2004_15_08_08_+0200_1Iif0.Qqhp.i8buy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iQCVAwUBQJ9+vLoLc+HYd7LFAQIBswP+KxEs7Vdjx6S9dlYOakLQEflMeuBWjs0L Cb32VDBjvMIJTDJUgtlb7uWT2zgw2m35iwsvoWtQN6vLEbtUQI+huGnjreQw5SGT xJ2ey4OWmCBBdr620n2R0TDBuAzb+jQSKQ4oTtbhmG69DhjKbhGo5EL2NbvWMwEO WR+l8+p3U3E= =uBNN -----END PGP SIGNATURE----- --Signature=_Mon__10_May_2004_15_08_08_+0200_1Iif0.Qqhp.i8buy--