Re: Aborting transaction on error

Поиск
Список
Период
Сортировка
От Mark Rae
Тема Re: Aborting transaction on error
Дата
Msg-id 3C835A54.B45DF1F7@inpharmatica.co.uk
обсуждение исходный текст
Ответ на Re: Aborting transaction on error  ("Greg Sabino Mullane" <greg@turnstep.com>)
Список pgsql-general
Greg Sabino Mullane wrote:
> > More specifically, I have some DBI scripts which under Oracle
> > just insert rows into a table with a unique constraint. If they
> > come across a duplicate row they detect and report this error and
> > continue. (The duplicates are discarded as they are not needed)
>
> So basically Oracle is reporting the problem and then moving on to
> the next record. If each insert is a separate transaction, this is
> perfectly understandable behavior.

No the whole thing is in one transaction, which is what I want so that
either all of the data from a particular file gets loaded or none of
it.

Oracle just reports the 'error' back through DBI::errstr and the
script can choose whether to abort the transaction or not. I was
hoping that there might be a way of making Postgres behave the same
way. i.e. The database just reports what happened and the user gets
to decide what constitutes a teminal error.

I had pretty much resigned myself to adding the duplicate checks,
I just wanted to make sure I had not overlooked an option somewhere
before I did so.

Thanks (also to the people who replied off list)

    -Mark

--
Mark Rae                                       Tel: +44(0)20 7074 4648
Inpharmatica                                   Fax: +44(0)20 7074 4700
m.rae@inpharmatica.co.uk                http://www.inpharmatica.co.uk/

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

Предыдущее
От: Martina Mostert
Дата:
Сообщение: Arrays in pgsql
Следующее
От: "Raymond O'Donnell"
Дата:
Сообщение: Re: April 1