From: | David Rio Deiros <driodeiros(at)gmail(dot)com> |
---|---|
To: | Douglas McNaught <doug(at)mcnaught(dot)org> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: C trigger using system(3) to execute a php script |
Date: | 2006-02-16 20:16:22 |
Message-ID: | 20060216201622.GB675@milhouse.digitaria.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Feb 16, 2006 at 02:24:06PM -0500, Douglas McNaught wrote:
> David Rio Deiros <driodeiros(at)gmail(dot)com> writes:
>
> > Then, I wanted to run the full php script from the trigger. I tried
> > the script manually, form the shell, and it worked perfectly. Notice
> > that the script doesn't generate any stdin/stdout output. So I changed
> > the system(3) parameter to call my php script instead of the test one.
> > I tried it and it didn't work. The php script doesn't perform the
> > modifications it suppose to in the database.
> >
> > The php script is about 150 lines long and performs like 5 or 6 sql
> > queries/inserts against the database.
>
> Why would you do it that way? The queries/inserts won't be rolled
> back if the transaction containing the trigger aborts (because they'd
> be done in a separate session). Why not just do your queries from C
> using the SPI interface?
The code was already in php... plus I am including some other php
files so I would have to parse that files from C if I write all in C. I
basically didn't want to do extra work.
Thanks for the answer,
David
From | Date | Subject | |
---|---|---|---|
Next Message | Douglas McNaught | 2006-02-16 20:21:09 | Re: C trigger using system(3) to execute a php script |
Previous Message | Douglas McNaught | 2006-02-16 19:24:06 | Re: C trigger using system(3) to execute a php script |