Re: [GENERAL] How to stop implicit rollback on certain errors?

Поиск
Список
Период
Сортировка
От Lincoln Yeoh
Тема Re: [GENERAL] How to stop implicit rollback on certain errors?
Дата
Msg-id 3.0.5.32.19991208172243.008d8b10@pop.mecomb.po.my
обсуждение исходный текст
Ответ на Increasing size of BLCKSZ  (Daniel Stolk <stolkd@email.com>)
Ответы Re: [GENERAL] How to stop implicit rollback on certain errors?
Список pgsql-general
Hi,

Say I have a transaction which goes like this:

begin;
insert into stuff;
do some nondatabase things based on last inserted id;
update a date in stuff;
commit;

It seems that if the date is out of the database range, everything is
thrown out. Is it possible to catch the database error and use a null date
instead, without throwing everything away?

Right now I only have two ways of proceeding:
1) commit before trying to update the date. And if things still don't work
- database has some non date related error, try to delete the previously
inserted stuff.
2) Make sure the dates are nice before trying to stick them in.

Unless there are I'll have to do 2).

Inserting stuff like
'27 Oct 19999 18:21:00 +0800' causes errors even though datetime supposedly
handles dates up to 1465001 AD.

I guess that's expected, and I should insert big years using another less
ambiguous format. What is the recommended format?

Thanks,

Link.


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

Предыдущее
От: "neil d. quiogue"
Дата:
Сообщение: REPLICATION
Следующее
От: "Martin Stanek"
Дата:
Сообщение: foreign key