Re: default_transaction_isolation = serializable causes crash under Hot Standby
Kevin Grittner <kevin.grittner@wicourts.gov>
From: "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
To: <tgl@sss.pgh.pa.us>
Cc: <robertmhaas@gmail.com>,<pgsql-hackers@postgresql.org>
Date: 2012-04-28T04:56:10Z
Lists: pgsql-hackers
Attachments
- hs-default-serializable-v1.diff (application/octet-stream) patch v1
> "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