Re: Detecting if current transaction is modifying the database

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Detecting if current transaction is modifying the database
Дата
Msg-id CACjxUsOeVNv_i9hTFpBx5Q+8BoLBHTu5DRTbpObVZRMG4qhVmg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Detecting if current transaction is modifying the database  (Christian Ohler <ohler@shift.com>)
Ответы Re: Detecting if current transaction is modifying the database  (Christian Ohler <ohler@shift.com>)
Список pgsql-general
On Fri, Aug 5, 2016 at 4:24 PM, Christian Ohler <ohler@shift.com> wrote:

Your check for a exclusive self-lock on transactionid should work.
It may be possible to find a way to do it that is less expensive,
so I would definitely encapsulate that in a function; but off-hand
I'm not thinking of a better way.

You might be tempted to use the txid_current() function, but note
that it assigns a transaction ID if there is not yet one assigned.
That has prevented that function from being useful to me in every
case I've considered it so far; I wish we had a function that told
the current transaction ID and just returned NULL if none has yet
been assigned.  I'm not sure what the best name would be for such a
function when we already have a function called txid_current()
which does something different from that.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Should a DB vacuum use up a lot of space ?
Следующее
От: Ioana Danes
Дата:
Сообщение: Corrupted Data ?