C trigger using system(3) to execute a php script

From: David Rio Deiros <driodeiros(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: C trigger using system(3) to execute a php script
Date: 2006-02-16 19:06:33
Message-ID: 20060216190632.GA32576@milhouse.digitaria.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

I have written a trigger in C for a postgresql engine (8.0.1) running
on a FreeBSD 5.4-RELEASE i386 machine.

I mainly used the example code from the documentation. The trigger
is working perfectly and it is triggered when I want to.

Then, at some point, I wanted to call an external php script from
the trigger to perform some sql statements against the database.
Before trying that I started writing a very simple php script
which basically created a file in /tmp. It worked.

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.

Can anyone advice me with these?

Thanks in advance,

David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jim_bowery 2006-02-16 19:23:52 Ident authentication failed without su to user
Previous Message Joshua D. Drake 2006-02-16 18:55:33 Re: NULLs in unique indexes; Was: Oracle purchases Sleepycat