Re: Calling Java from psql (was Re: requesting help)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: A James Lewis <james(at)fsck(dot)co(dot)uk>, Peter Mount <peter(at)retep(dot)org(dot)uk>, Mathijs Brands <mathijs(at)ilse(dot)nl>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Calling Java from psql (was Re: requesting help)
Date: 2001-03-29 17:13:18
Message-ID: 22850.985885998@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Graham Vickrage 2001-03-29 18:42:15 Update taking forever
Previous Message will trillich 2001-03-29 17:07:50 Re: inconsistent functionality with LIKE operator