Re: 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: Re: C trigger using system(3) to execute a php script
Date: 2006-02-18 18:59:16
Message-ID: 20060218185916.GA14194@milhouse.oc.cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-02-18 19:34:23 Re: C trigger using system(3) to execute a php script
Previous Message Tom Lane 2006-02-18 18:40:09 Re: Mixing different LC_COLLATE and database encodings