Re: Transaction control overhauling

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: Transaction control overhauling
Дата
Msg-id BANLkTikJnMXGPC=T7Fpwu97yNhh87ieEMg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Transaction control overhauling  (Federico Di Gregorio <federico.digregorio@dndg.it>)
Список psycopg
On Thu, May 12, 2011 at 3:07 PM, Federico Di Gregorio
<federico.digregorio@dndg.it> wrote:
> On 12/05/11 12:36, Daniele Varrazzo wrote:
> [snip]
>>> Or,
>>> maybe even better, we can have 4 attributes and the set_transaction() as
>>> a shortcut:
>>>
>>>        conn.autocommit
>>>        conn.transaction_isolation_level
>>>        conn.transaction_readonly
>>>        conn.transaction_deferrable
>>>        conn.set_transaction(isolation_level, autocommit, readonly, ...)
>>
>> Wow, I thought you wanted to limit the dbapi extensions :)
>
> Well, I know. But, in fact, if we introduce the possibility to set such
> parameters we also _need_ a way to retrieve them and attributes are the
> only sensible way to retrive them (a function returning a tuple is
> another way but stinks.)

I was thinking about documenting that you can issue "SHOW
default_whatever" and get the result from there. It isn't the handiest
of the procedures, OTOH it's also not a very common use case not
knowing what the level is and wanting to know it - the biggest use
case is just to set the level desired and use the connection. This
possibility is not available with "autocommit" instead, as it's
something all internal to the connection object and not related to the
PG session.

-- Daniele

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

Предыдущее
От: Federico Di Gregorio
Дата:
Сообщение: Re: Transaction control overhauling
Следующее
От: Oswaldo
Дата:
Сообщение: Re: Transaction control overhauling