Re: transaction problem using cursors

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Thomas Pundt" <thomas(dot)pundt(at)rp-online(dot)de>
Cc: pgsql-general(at)postgresql(dot)org, "Pit M(dot)" <fmi-soft(at)gmx(dot)de>
Subject: Re: transaction problem using cursors
Date: 2007-06-11 13:16:07
Message-ID: 162867790706110616s73add729tac399834c41e9c1d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2007-06-11 13:20:15 Re: Functions that return both Output Parameters and recordsets
Previous Message Pit M. 2007-06-11 13:15:56 Re: transaction problem using cursors