Skip site navigation (1) Skip section navigation (2)

Edit Grid and default_transaction_read_only

From: J Chapman Flack <jflack(at)math(dot)purdue(dot)edu>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Edit Grid and default_transaction_read_only
Date: 2012-06-20 13:55:01
Message-ID: 4FE1D635.70003@math.purdue.edu (view raw or flat)
Thread:
Lists: pgadmin-hackers
Hi,

I've never hacked on pgAdmin yet, so I'm curious from those who have:

What sounds like the smartest way to make updates in the Edit Grid
not fail when connected to a database with default_transaction_read_only
set to on? :

1. Just send every update wrapped in START TRANSACTION READ WRITE
    ... COMMIT ?

2. Don't do that by default, but trap the "error: transaction is
    read only" and reissue the update with START TRANSACTION READ WRITE
    in that case?

3. Query the backend for SHOW DEFAULT_TRANSACTION_READ_ONLY and then
    issue updates wrapped in START TRANSACTION READ WRITE only if it
    was ON?

4. Just send a SET SESSION DEFAULT_TRANSACTION_READ_ONLY TO OFF and
    forget about it?

I'm asking because we noticed in 1.14.2 that it doesn't do any of
these things yet, but just surprises the innocent user with the
"error: transaction is read only".

Thanks,
Chapman Flack
Dept. of Mathematics, Purdue

Responses

pgadmin-hackers by date

Next:From: Dave PageDate: 2012-06-25 11:52:59
Subject: pgAgent commit: Support new locations for the OSX SDK in recentversion
Previous:From: pgAdmin TracDate: 2012-06-20 13:02:11
Subject: Re: [pgAdmin III] #360: Enum only showing as array type in new function dialog

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group