Re: Is there any special way to a trigger send a signal to outer application?

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: durumdara <durumdara(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there any special way to a trigger send a signal to outer application?
Date: 2009-04-02 08:22:11
Message-ID: 49D475B3.3090003@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

durumdara wrote:

> Which way is supports by PGSQL trigger?

One way you did NOT mention, but you need to look into: use LISTEN and
NOTIFY. Whether or not this is suitable depends on how your application
is accessing PostgreSQL, as IIRC some database access APIs (eg: ODBC) do
not support LISTEN/NOTIFY.

In answer to your questions:

> a.) Starting a new process with any params (this app. can send a WM_*
> message to my service)?

You could use PL/Python or PL/Perl to invoke the process. Your function
must be written extremely carefully to avoid producing a gaping security
hole, though, if you have multiple levels of trust accessing your database.

> b.) Sending a WM_* message (PostMessage) to my service?

Maybe you could do it via PL/Python or PL/Perl using a DCOM or some
other win32-specific extension module for those languages, too.

You could also do that by writing a custom C extension function to
PostgreSQL, compiling it, and loading it into the server. A bit of work,
though.

> c.) Sending a TCP message to my service?

Same answer as (a) and (b), really - use PL/Python or PL/Perl.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2009-04-02 08:23:20 Re: possible small contribution to the PostgreSQL manual? Example for two-phase commit section.
Previous Message linnewbie 2009-04-02 08:20:00 Posgres Adding braces at beginning and end of text (html) content