Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 78AD6AF139B for ; Sun, 22 Jan 2012 13:51:54 -0400 (AST) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rp1a5-0002TL-IY for pgsql-admin@postgresql.org; Sun, 22 Jan 2012 17:51:54 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Sun, 22 Jan 2012 11:51:40 -0600 Message-Id: <4F1BF8430200002500044AB1@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Sun, 22 Jan 2012 11:51:31 -0600 From: "Kevin Grittner" To: "Jesper Krogh" , Subject: Re: Force explicit transactions on insert / update References: <4F1A5C57.1010605@krogh.cc> In-Reply-To: <4F1A5C57.1010605@krogh.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201201/127 X-Sequence-Number: 39039 Jesper Krogh 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