From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Jesper Krogh <jesper@krogh.cc>
To: pgsql-admin@postgresql.org
Subject: Re: Force explicit transactions on insert / update
Date: Sun, 22 Jan 2012 11:51:31 -0600
Message-ID: <4F1BF8430200002500044AB1@gw.wicourts.gov> (raw)
In-Reply-To: <4F1A5C57.1010605@krogh.cc>
References: <4F1A5C57.1010605@krogh.cc>
Jesper Krogh <jesper@krogh.cc> wrote:
> Is there any way I can force explicit use of transactions on
> insert/updates?
>
> I do have users sitting on the system, that may forget to code it
> that way and it would be nice to be able to force the database to
> just kick them out if it didn't happen.
Not that I can think of, unless you pass the queries through some
proxy which enforces the rule. Generally, a statement outside of an
explicit transaction block starts its own transaction for just that
statement, just as if the statement were wrapped in BEGIN/COMMIT.
You could maybe get glimpses of such statements by periodically
looking at pg_stat_activity for statements which have the same
timestamp for xact_start and query_start.
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, jesper@krogh.cc
Subject: Re: Force explicit transactions on insert / update
In-Reply-To: <4F1BF8430200002500044AB1@gw.wicourts.gov>
References: <4F1A5C57.1010605@krogh.cc> <4F1BF8430200002500044AB1@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox