Re: Endless For Loop in an insert trigger - Mailing list pgsql-general

From Richard Huxton
Subject Re: Endless For Loop in an insert trigger
Date
Msg-id 40DBE673.6020708@archonet.com
Whole thread Raw
In response to Endless For Loop in an insert trigger  (Luis Agostinho <luis.agostinho@consumo-pt.coop>)
List pgsql-general
Luis Agostinho wrote:
> Hello
> I?m using this function to be executed within an after insert trigger, but
> the part of code above wich is "painted" by blue gets in an endless loop.
> I could use some help

Luis - not sure what you mean by "painted by blue", but there are some
basic steps I always use when debugging triggers:
  1. Put RAISE NOTICE messages throughout the code
  2. Turn statement logging on in my postgresql.conf

Note that you must do:
   RAISE NOTICE ''My var = % which is nice'', my_var;
and _not_
   RAISE NOTICE ''My var = '' || my_var || '' which is nice'';

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Achilleus Mantzios
Date:
Subject: tsearch2,pgsql 7.4.[1|2], pg_dump problem
Next
From: Oleg Bartunov
Date:
Subject: Re: tsearch2,pgsql 7.4.[1|2], pg_dump problem