pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: domingo@dad-it.com
To: pgsql-sql@postgresql.org
Subject: Re: A bug in triggers PG 7.1.3 or misunderstand ?
Date: 28 Sep 2001 01:28:25 -0700
Message-ID: <70a76315.0109280028.439dff84@posting.google.com> (raw)
References: <28856.1001608373@sss.pgh.pa.us>

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 ?



view thread (3+ messages)

Message-ID: <70a76315.0109280028.439dff84@posting.google.com>
Permalink:  ../70a76315.0109280028.439dff84@posting.google.com/
Also on:    postgresql.org/message-id/70a76315.0109280028.439dff84@posting.google.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: domingo@dad-it.com
  Subject: Re: A bug in triggers PG 7.1.3 or misunderstand ?
  In-Reply-To: <70a76315.0109280028.439dff84@posting.google.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox