Jeff Barrett wrote:
> Thanks for the suggestions.
>
> I am running 7.1.2 and going to 7.1.3 soon.
>
> If I use pl/tclu or pl/perlu I can call this executable from within the
> code?
>
> I have a signifigant limitation, I cannot duplicate the action of the
> programs I want to call in a program I write within postgres, I need to call
> the executable (In this one case it is a shell script but I have others
> where it is a binary).

    That's  kind of a fuzzy explanation. If this "action" of your
    programs in any way affects data, that should be part of  the
    triggers  transaction,  then what you want to do is broken by
    design.

    In detail, if the external program you're  calling  from  the
    trigger  connects to the database, updates it and terminates,
    the transaction that fired the trigger  can  still  rollback,
    discarding  all changes that caused the trigger to get fired.
    Thus, the database should look like  the  trigger  never  got
    fired  -  but  how  do  you undo the changes of your external
    program? It connected to  the  database,  did  it's  updates,
    committed and terminated. You'll have no chance to undo that.

    So if you really intend to do what  it  smells  like,  you're
    better off moving all the "external program"s logic into some
    function inside  of  the  database,  and  call  it  from  the
    external program as well as the trigger.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== [EMAIL PROTECTED] #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to