Help with transactions - Mailing list pgsql-general

From Stephen Howie
Subject Help with transactions
Date
Msg-id 423AE43C.4050004@centwire.com
Whole thread Raw
Responses Re: Help with transactions
List pgsql-general
Hello all,

I have a java program that excepts print streams and inserts in into a
spool table as a bytea.  This fires a pl/pgsql trigger that passes the
bytea to a pl/perl function to process the bytea and spits the results
as an array back.  It then proceeds to insert the data into multiple
tables.  Problem is that two of the tables data is inserted into inside
this transaction, one has a foreign key to the other.  As you can guess
I get a foreign key violation because the transaction is not committed
and as far as I understand PostgreSQL does not support dirty reads or
nested transactions.  I have two questions.  1) what is there another
way to handle this transaction that would resolve this violation without
using dirty reads and 2) It looks like running the trigger after insert
on a table does not run as a separate transaction.  Is the insert to
that table suppose to fail if the trigger fails?  To me that defeats the
purpose of having a trigger after insert.

Thanks for any help

--
-------------------------
Stephen Howie



Attachment

pgsql-general by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: Statistics with PostgreSQL
Next
From: Edgar Amorim
Date:
Subject: Re: Install error at rpm package + Fedora Core3