Re: perlu: did I find a bug, or did I make one? - Mailing list pgsql-sql

From Tom Lane
Subject Re: perlu: did I find a bug, or did I make one?
Date
Msg-id 19467.1180968768@sss.pgh.pa.us
Whole thread Raw
In response to perlu: did I find a bug, or did I make one?  ("Bart Degryse" <Bart.Degryse@indicator.be>)
Responses Re: perlu: did I find a bug, or did I make one?
List pgsql-sql
"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


pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Versionning (was: Whole-row comparison)
Next
From: "Bart Degryse"
Date:
Subject: Re: perlu: did I find a bug, or did I make one?