Help with transactions

From: Stephen Howie <showie(at)centwire(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Help with transactions
Date: 2005-03-18 14:22:52
Message-ID: 423AE43C.4050004@centwire.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
showie.vcf text/x-vcard 190 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edgar Amorim 2005-03-18 14:38:13 Re: Install error at rpm package + Fedora Core3
Previous Message Joe Maldonado 2005-03-18 13:35:22 pg_atributes index space question