pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bart Degryse <Bart.Degryse@indicator.be>
Cc: pgsql-sql@postgresql.org
Subject: Re: perlu: did I find a bug, or did I make one?
Date: Mon, 04 Jun 2007 10:52:48 -0400
Message-ID: <19467.1180968768@sss.pgh.pa.us> (raw)
In-Reply-To: <466405B4.A3DD.0030.0@indicator.be>
References: <465D44F3.A3DD.0030.0@indicator.be>
	<20070530141349.GA76707@winni e.fuhr.org>
	<466405B4.A3DD.0030.0@indicator.be>

"Bart Degryse" <Bart.Degryse@indicator.be> writes:
> CREATE TRIGGER "afh_test_tr" BEFORE INSERT 
> ON "public"."afh_test" FOR EACH ROW 
> EXECUTE PROCEDURE "public"."temp_func1"();
>  
> CREATE OR REPLACE FUNCTION "public"."temp_func1" () RETURNS trigger AS
> $body$
> BEGIN
>   IF NEW.dataareaid =3D 'lil' THEN
>     RAISE EXCEPTION '% foutje %', NEW.dataareaid, NEW.name;
>   elsIF NEW.dataareaid =3D 'bol' THEN
>     RAISE EXCEPTION '% nog een foutje %', NEW.dataareaid, NEW.name;
>   END IF;
>   RETURN NULL;
> END;
> $body$
> LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

You probably don't want this trigger doing RETURN NULL; that's
turning all your inserts into no-ops.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <19467.1180968768@sss.pgh.pa.us>
Permalink:  ../19467.1180968768@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19467.1180968768@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, Bart.Degryse@indicator.be
  Subject: Re: perlu: did I find a bug, or did I make one?
  In-Reply-To: <19467.1180968768@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