pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: schaefer@alphanet.ch
Cc: pgsql-sql@postgresql.org
Subject: Re: Some additional PostgreSQL questions
Date: Tue, 28 May 2002 10:38:06 -0400
Message-ID: <2976.1022596686@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.3.96.1020528092524.15151A-100000@defian.alphanet.ch>
References: <Pine.LNX.3.96.1020528092524.15151A-100000@defian.alphanet.ch>

schaefer@alphanet.ch writes:
> The funny thing is the DELETE not saying an error, but not deleting (which
> is good, but I would like an error).
>> 
>> Then make your trigger raise an error.  Returning NULL out of the

> It does:

Hm.  The "NEW.lot" part will not work in an AFTER DELETE trigger (I'm a
bit surprised that it doesn't raise an error --- I guess it is inserting
a NULL instead).  You want OLD.lot for the DELETE case.

I don't know why you are getting the DELETE 0 result, but it's not
because of this trigger.  AFTER triggers can't suppress individual
row actions, because the action is already done --- the most they
can do is raise an error to abort the whole transaction.  Perhaps
you still have a BEFORE trigger in there somewhere?

			regards, tom lane



view thread (4+ messages)

Message-ID: <2976.1022596686@sss.pgh.pa.us>
Permalink:  ../2976.1022596686@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2976.1022596686@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, schaefer@alphanet.ch
  Subject: Re: Some additional PostgreSQL questions
  In-Reply-To: <2976.1022596686@sss.pgh.pa.us>

* 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