About Triggers - Mailing list pgsql-novice

From wsmuir@islandnet.com
Subject About Triggers
Date
Msg-id 010330042525@islandnet.com
Whole thread Raw
List pgsql-novice
Admittedly, this is a bit of a kludge, but I'm trying to do this for a
website backend. I'm using 7.0.2, Redhat and the SPI to "do stuff"
with data and ImageMagick.  The interface to Magick is working well,
but I'm attempting to optimize the time it takes for the SPI function
to complete.  Specifically, I have an insert which as a side-effect
(trigger after insert) should start the SPI function.  My problem is
that initial testing has the insert waiting for the trigger to finish,
and I don't need or want this to happen.  The resulting image doesn't
need to be used until later, but I also don't want to be rebuilding
images at the time they're requested...

does an 'after' trigger not start its own thread and release the
triggering query(insert et al)?  Is there a way of getting the
behaviour I wish, or am I going to have to resort to Pthreads in C, or
will this even accomplish this?

the way I'm testing this is calling a pl function which returns a
meaningless text string but has the insert in it...with pgaccess I
don't get my meaningless string back until after the last debug line
in the PL trigger gets logged (raise notice)...

Thanks,
Scott.

Thank you...
Scott

pgsql-novice by date:

Previous
From: Vijay Deval
Date:
Subject: Re: Query performance question
Next
From: chris Günther
Date:
Subject: DELETE FROM fails