Re: transaction problem using cursors

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: transaction problem using cursors
Дата
Msg-id 20070611134058.GC25296@svana.org
обсуждение исходный текст
Ответ на Re: transaction problem using cursors  ("Pit M." <fmi-soft@gmx.de>)
Ответы Re: transaction problem using cursors  ("Pit M." <fmi-soft@gmx.de>)
Список pgsql-general
On Mon, Jun 11, 2007 at 03:28:22PM +0200, Pit M. wrote:
> We handle exceptions errors through libpq, and if a FETCH leads to such
> a runtime error, we try to FETCH the first record again.
> The problem is that we can't use this cursor any more -> it seems to be
> corrupt after that error.

An aborted transaction is an aborted transaction, you have to rollback
to a known state before you can go on.

I'm not sure why you can't just change the queries, but in the
particluar case you give, why not just treat them as strings to start
with:

   WHERE "CUSTOMERS"."ZIP" >= '10000'
                    AND "CUSTOMERS"."ZIP" < '20000'

That will produce the same result, but without any chance of errors...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Pit M."
Дата:
Сообщение: Re: transaction problem using cursors
Следующее
От: Sean Davis
Дата:
Сообщение: Re: Distributing PostGres database to various customers