Re: Detecting if current transaction is modifying the database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christian Ohler <ohler(at)shift(dot)com>
Cc: Kevin Grittner <kgrittn(at)gmail(dot)com>, Rob Sargent <robjsargent(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Detecting if current transaction is modifying the database
Date: 2016-08-10 01:06:52
Message-ID: 13030.1470791212@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Christian Ohler <ohler(at)shift(dot)com> writes:
> ... (But that's a guess. AFAICT, creating a temp table
> also produces WAL records, so perhaps checking for them is no better
> than checking for a transaction ID after all.)

Well, creating a temp table makes entries in the system catalogs, which
requires both an XID and WAL entries. The same goes for most database
alterations, really. There are very limited cases where you can produce
WAL without assigning an XID or vice versa, but I'm not sure it's worth
your while to distinguish.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patrick B 2016-08-10 01:33:11 permissions PostgreSQL 9.5
Previous Message Christian Ohler 2016-08-10 01:02:01 Re: Detecting if current transaction is modifying the database