Re: enforcing transaction mode for read-write queries.

From: David Johnston <polobo(at)yahoo(dot)com>
To: Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: enforcing transaction mode for read-write queries.
Date: 2012-10-01 03:24:13
Message-ID: 117F1FA5-05E2-45D4-B90E-69D1F57A8612@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sep 30, 2012, at 22:22, Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)com> wrote:

> Hi ,
>
> We are a PerlDBI shop and and are doing a code migration from
> implicit transaction mode (ie, AutoCommit=>0) to an explicit mode (ie, AutoCommit=>1) .
>
> While the code migration is ongoing (or even permanently) We wish that postgresql reject
> any UPDATE , DELETE , INSERT , nextval , setval etc unless the session is in a transaction
> mode . ie they should be preceded by an explicit "BEGIN work;". This shall immensely help
> us to prevent many bugs in the migration.
>
> Is there any way to accomplish that ? Any help shall be greatly appreciated.
>
> regds
> Rajesh Kumar

http://www.postgresql.org/docs/9.0/static/runtime-config-client.html

default_transaction_read_only

Set this to true for the database then whenever you actually want to allow modification you override it on a per-transaction basis.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Darren Duncan 2012-10-01 03:24:47 Re: opened connection
Previous Message Rajesh Kumar Mallah 2012-10-01 02:22:58 enforcing transaction mode for read-write queries.