Re: C trigger using system(3) to execute a php script - Mailing list pgsql-general

From David Rio Deiros
Subject Re: C trigger using system(3) to execute a php script
Date
Msg-id 20060218185916.GA14194@milhouse.oc.cox.net
Whole thread Raw
In response to Re: C trigger using system(3) to execute a php script  (Douglas McNaught <doug@mcnaught.org>)
Responses Re: C trigger using system(3) to execute a php script  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Hi there,

I just wanted to let you know that I finally made the trigger work using
an external php script. Actually it always worked, the problem is that
I was trying the trigger in one machine and testing the results in other.
I know, very lame.

Some people suggested plphp, I tried it but I had issues trying to compile
it. But the project looks promising anyway.

Also, I took me a while to figure out how to compile my trigger on
FreeBSD and MacOSX/Darwin. Finally I found this in the documentation:

http://www.postgresql.org/docs/8.0/interactive/xfunc-c.html

which perfectly explains what flags to pass to gcc in order to
compile your code on those and other platforms.

I didn't find any link or reference to that document in the trigger
section. Do you think it would be a good idea to do that?

Thanks,

David

> David Rio Deiros <driodeiros@gmail.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.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Mixing different LC_COLLATE and database encodings
Next
From: Andreas Kretschmer
Date:
Subject: Re: Non-Overlaping date interval index