Re: default_transaction_isolation = serializable causes crash under Hot Standby - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: default_transaction_isolation = serializable causes crash under Hot Standby
Date
Msg-id 4F9B321A02000025000474F5@gw.wicourts.gov
Whole thread Raw
Responses Re: default_transaction_isolation = serializable causes crash under Hot Standby  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
> "Kevin Grittner"  wrote:
> Tom Lane  wrote:
>
>> Yeah, it would definitely be nicer if BEGIN; SET TRANSACTION LEVEL
>> would work too. Maybe the place to put the check is where we
>> establish the transaction snapshot.
>
> That makes sense,

> I'll take a shot at it sometime today,

Attached.  With a default setting in postgresql.conf it handles
Robert's test case nicely, and does what Tom asks for above:

test=# set default_transaction_isolation = 'serializable';
SET
test=# begin;
BEGIN
test=# select 1;
ERROR:  can not create a serializable snapshot during recovery
test=# rollback;
ROLLBACK
test=# begin;
BEGIN
test=# set transaction isolation level repeatable read;
SET
test=# select 1;
 ?column?
----------
        1
(1 row)

test=# commit;
COMMIT

But if you set it in the postgresql.conf file, it's not pretty:

kevin@kevin-desktop:~$ psql -p 5433 test
psql: FATAL:  can not create a serializable snapshot during recovery

Ideas?

-Kevin



Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpython crash (PG 92)
Next
From: Simon Riggs
Date:
Subject: Re: Re: xReader, double-effort (was: Temporary tables under hot standby)