Re: transaction problem using cursors

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: transaction problem using cursors
Дата
Msg-id 162867790706110616s73add729tac399834c41e9c1d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: transaction problem using cursors  (Thomas Pundt <mlists@rp-online.de>)
Ответы Re: transaction problem using cursors  ("Pit M." <fmi-soft@gmx.de>)
Список pgsql-general
>
> I didn't try myself, but wrapping the whole into a PL/pgSQL function and
> using exceptions might do the work;
>
>

It's not good advice. I tested it, and problem is in where clause. I
don't understand problem well, but one possibility is change from cast
to to_number function like:

postgres=# begin;
BEGIN
postgres=# declare c cursor for select * from fx where to_number(b,'99999') > 0;
DECLARE CURSOR
postgres=# fetch from c;
 a  | b
----+----
 10 | 20
(1 row)

postgres=# fetch from c;
 a  |  b
----+-----
 10 | a20
(1 row)

But still this solution is +/- correct

Regards
Pavel

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

Предыдущее
От: "Pit M."
Дата:
Сообщение: Re: transaction problem using cursors
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Functions that return both Output Parameters and recordsets