Re: Edit Grid and default_transaction_read_only

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Edit Grid and default_transaction_read_only
Дата
Msg-id 1340867479.1823.4.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Edit Grid and default_transaction_read_only  (J Chapman Flack <jflack@math.purdue.edu>)
Ответы Re: Edit Grid and default_transaction_read_only  (J Chapman Flack <jflack@math.purdue.edu>)
Список pgadmin-hackers
On Wed, 2012-06-20 at 09:55 -0400, J Chapman Flack wrote:
> Hi,
>
> I've never hacked on pgAdmin yet, so I'm curious from those who have:
>

Sorry for not answering sooner. Way overloaded here.

> 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".
>

Well, if the DBA sets default_transaction_read_only to off, it's for a
good reason. So, we shouldn't override this by default. It would be
better that the edit tool finds that default_transaction_read_only is
on, and asks if the user wants to turn it off so that he could make
INSERT/DELETE/UPDATE.


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


В списке pgadmin-hackers по дате отправления:

Предыдущее
От: "pgAdmin Trac"
Дата:
Сообщение: [pgAdmin III] #365: pg_terminate_backend() can be used on backends with matching role on 9.2
Следующее
От: Dave Page
Дата:
Сообщение: Re: [pgadmin-support] Compile Source Code