Skip site navigation (1) Skip section navigation (2)

About Triggers

From: wsmuir(at)islandnet(dot)com
To: pgsql-novice(at)postgresql(dot)org
Subject: About Triggers
Date: 2001-03-30 12:25:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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)...


Thank you...

pgsql-novice by date

Next:From: Eduardo KotujanskyDate: 2001-03-30 13:09:35
Subject: client for windows
Previous:From: Lukas ErtlDate: 2001-03-29 21:33:29
Subject: Re: Query performance question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group