Re: how to execute a C program via trigger ?

Поиск
Список
Период
Сортировка
От S.F. Lee
Тема Re: how to execute a C program via trigger ?
Дата
Msg-id 20001205022029.62885.qmail@web10401.mail.yahoo.com
обсуждение исходный текст
Ответ на how to execute a C program via trigger ?  ("S.F. Lee" <sflee_tw@yahoo.com>)
Ответы Join performance  ("Koen Antonissen" <koen@v3.com>)
Re: how to execute a C program via trigger ?  (Clayton Cottingham <clayton@marketingchallenge.com>)
Список pgsql-sql
Thank for your hint, but I have some questions :
 1. Do I have to compile the C program into a shared
object (*.so)?  2. Do I have to use SPI (SPI is too complicate to
me)? 
 My request is very simple. I have a program
(my_c_program)  that I can execute it under shell by typing
(my_c_program). Basically my_c_program is not a function.
 I want to fire a trigger after I update the field
(x) in table foo, and the trigger can run the
my_c_program. Is there an easy way to execute a
PROCESS
via trigger?
  regards,    S.F. Lee

--- clayton cottingham
<clayton@marketingchallenge.com> wrote:
> take a look at the contrib sections fti or fulltext
> index example
> 
> it takes you through it all
> 
> 
> 
> "S.F. Lee" wrote:
> > 
> > Hi,
> > 
> >    I am using Red Hat 6.1 + PostgreSQL 7.0.3. All
> of
> > my
> > applications are developed by C and ECPG.  I would
> > like to know how to execute a C program by
> Trigger,for
> > example:
> > 
> >    1. I have a program my_c_program.c shuch as:
> > 
> > #include <stdio.h>
> > main()
> > {
> >    printf("Hello World !\n");
> > }
> > 
> >    2. I create a table foo by following command
> > 
> > CREATE TABLE foo
> >         (
> >         x      int4
> >         );
> > 
> >    3. create a trigger  foo_trig :
> > 
> > create trigger foo_trig after update
> >     on foo for each row execute procedure sql_c();
> > 
> >    4. I don't know how to design sql_c(), can
> anyone
> >       give a small plpsql program that can execute
> >       my_c_program?
> > 
> >    regards,    S.F. Lee
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Shopping - Thousands of Stores. Millions of
> Products.
> > http://shopping.yahoo.com/


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/


В списке pgsql-sql по дате отправления:

Предыдущее
От: Mike Castle
Дата:
Сообщение: Re: reinitialize a sequence?
Следующее
От: "Koen Antonissen"
Дата:
Сообщение: Join performance