Ask a Question related to PostgreSQL / PGSQL, Design and Development.
-
Marek Lewczuk #1
Trace triggers
Hi,
I have a table with many triggers. Now, it can happen that in middle of
execution one of table's triggers there will be unknown error (like
"NEW" is not assigned yet) - is there a way to trace which trigger fired
this error ?
Thanks in advance.
ML
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
[url]http://archives.postgresql.org[/url]
Marek Lewczuk Guest
-
triggers in DB2
Hello, where can I find some tutorial, help, samples about writing triggers in DB2 ? Regards Piotr -
Triggers
You'll need to create two triggers. One for AFTER INSERT One for AFTER UPDATE If what you need is two updates to fire after insert or update,... -
Help with triggers
Donnie Rakes wrote: Do you want the before trigger instead? -
Do triggers use *lazy* OR ?
I don't believe it will execute the OR if the first expression is true. But you can test it easy enough by making the UDF error if called and run... -
viewing triggers?
How can I view all triggers for a table? I am exporting a production table to a test machine and need to make sure that all triggers have been... -
Terry Lee Tucker #2
Re: Trace triggers
I don't know if there is some built in way of doing it, but we have
implemented the following in all our trigger code:
DECLARE
....
....
dbg BOOLEAN DEFAULT False; -- debug messages flag
BEGIN
IF dbg THEN
RAISE NOTICE ''% (%)'', TG_NAME, TG_OP;
END IF;
While developing triggers or a series of triggers, we turn that dbg flag on.
Then we can see what is happening.
On Thursday 13 January 2005 09:14 am, Marek Lewczuk saith:__> Hi,
> I have a table with many triggers. Now, it can happen that in middle of
> execution one of table's triggers there will be unknown error (like
> "NEW" is not assigned yet) - is there a way to trace which trigger fired
> this error ?
>
> Thanks in advance.
>
> ML
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> [url]http://archives.postgresql.org[/url]
Work: 1-336-372-6812
Cell: 1-336-363-4719
email: [email]terry@esc1.com[/email]
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
[url]http://archives.postgresql.org[/url]
Terry Lee Tucker Guest
-
Tom Lane #3
Re: Trace triggers
Marek Lewczuk <newsy@lewczuk.com> writes:
Use PG 7.4 or later, and look at the CONTEXT part of the error message.> I have a table with many triggers. Now, it can happen that in middle of
> execution one of table's triggers there will be unknown error (like
> "NEW" is not assigned yet) - is there a way to trace which trigger fired
> this error ?
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Tom Lane Guest



Reply With Quote

