From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: A James Lewis <james@fsck.co.uk>
Cc: Peter Mount <peter@retep.org.uk>
Cc: Mathijs Brands <mathijs@ilse.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: Calling Java from psql (was Re: requesting help)
Date: Thu, 29 Mar 2001 12:13:18 -0500
Message-ID: <22850.985885998@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.30.0103291857230.2091-100000@peter.localdomain>
References: <Pine.LNX.4.30.0103291857230.2091-100000@peter.localdomain>
Peter Eisentraut <peter_e@gmx.net> writes:
> A James Lewis writes:
>> Before I go investigating this, is it possible to trigger an arbitrary
>> program from the SQL, say a shell script?
> At the lowest level, you can generally do anything a C program can do.
> Writing the equivalent of system() in SQL should be rather trivial.
I'm generally pretty suspicious of any system design that requires
calling outside programs from an SQL function. The problem is that
this fundamentally breaks transactional semantics: if the transaction
is rolled back after the function call, its effects inside the database
disappear ... but there's no way to roll back whatever the outside
program did. Now you have a consistency problem.
I'd suggest thinking hard about how to restructure your system design
so that you do not need this capability. Yes, it'd be easy to implement,
but that doesn't make it a good idea.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, james@fsck.co.uk, peter@retep.org.uk, mathijs@ilse.nl
Subject: Re: Calling Java from psql (was Re: requesting help)
In-Reply-To: <22850.985885998@sss.pgh.pa.us>
References: <Pine.LNX.4.30.0103291857230.2091-100000@peter.localdomain> <22850.985885998@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox