Help with transactions

Поиск
Список
Период
Сортировка
От Stephen Howie
Тема Help with transactions
Дата
Msg-id 423AE43C.4050004@centwire.com
обсуждение исходный текст
Ответы Re: Help with transactions  (Michael Fuhr <mike@fuhr.org>)
Список 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



Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Dann Corbit"
Дата:
Сообщение: Re: Statistics with PostgreSQL
Следующее
От: Edgar Amorim
Дата:
Сообщение: Re: Install error at rpm package + Fedora Core3