Received: from mail1.hub.org (webmail.hub.org [216.126.85.1]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8T64pO85404 for ; Sat, 29 Sep 2001 02:04:51 -0400 (EDT) (envelope-from news@news.tht.net) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail1.hub.org (8.11.3/8.11.4) with ESMTP id f8S8Y9S07846 for ; Fri, 28 Sep 2001 04:34:09 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f8S8SQu17848 for pgsql-sql@postgresql.org; Fri, 28 Sep 2001 04:28:26 -0400 (EDT) (envelope-from news) From: domingo@dad-it.com (Domingo Alvarez Duarte) X-Newsgroups: comp.databases.postgresql.sql Subject: Re: A bug in triggers PG 7.1.3 or misunderstand ? Date: 28 Sep 2001 01:28:25 -0700 Organization: http://groups.google.com/ Lines: 24 Message-ID: <70a76315.0109280028.439dff84@posting.google.com> References: <28856.1001608373@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200110/14 X-Sequence-Number: 4969 tgl@sss.pgh.pa.us (Tom Lane) wrote in message news:<28856.1001608373@sss.pgh.pa.us>... > I think you need "return old", not "return new", in the body of the > trigger if you want the delete to take place. new would be NULL in > a delete situation ... > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html Ok I saw that in the documentation so I tryied a variant of it: if TG_OP = 'DELETE' then return old; else return new; end if; But the TG_OP comes empty and it allawys try return new preventing the delete to happen. And that was supposed to work isn't it ?