Skip site navigation (1) Skip section navigation (2)

Re: Force explicit transactions on insert / update

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jesper Krogh" <jesper(at)krogh(dot)cc>,<pgsql-admin(at)postgresql(dot)org>
Subject: Re: Force explicit transactions on insert / update
Date: 2012-01-22 17:51:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Jesper Krogh <jesper(at)krogh(dot)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.

In response to

pgsql-admin by date

Next:From: Nicholson, Brad (Toronto, ON, CA)Date: 2012-01-23 13:10:26
Subject: Re: Best practise for upgrade of 24GB+ database
Previous:From: c kDate: 2012-01-21 18:07:40
Subject: Re: grouping of query data in xml

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group