Re: concurrency in stored procedures

From: Ottavio Campana <ottavio(at)campana(dot)vi(dot)it>
To: Ottavio Campana <ottavio(at)campana(dot)vi(dot)it>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: concurrency in stored procedures
Date: 2007-03-23 23:15:09
Message-ID: 46045F7D.1060301@campana.vi.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ottavio Campana wrote:
> Anyway, apart from a couple of errors in the code i wrote (an in isn't
> closed and exception handling is not correctly written), can I be sure
> that the code in the sub-block works an a snapshot of the db?

It seems not to work, I put it into my application and I got

Error Type: ProgrammingError
Error Value: ERROR: SET TRANSACTION ISOLATION LEVEL must be called
before any query CONTEXT: SQL statement "set transaction isolation level
serializable" PL/pgSQL function "test_function" line 31 at SQL statement
select test_function ( 11, 'tizio', '', ' ', '', ' ', '', ' ', ' ', ' ',
'', '', ' ', ' ', '0.0', ' ', '', 1, 1, 0.0, 1 ) as risultato;

So I think I'll have to use locking....

--
Non c'e' piu' forza nella normalita', c'e' solo monotonia.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Liu 2007-03-24 03:24:41 Re: question: knopixx and postgresql on flash drive
Previous Message Tom Lane 2007-03-23 23:07:43 Re: Insert fail: could not open relation with OID 3221204992