Re: autocommit to off? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: autocommit to off?
Date
Msg-id 200403092318.i29NIQb29465@candle.pha.pa.us
Whole thread Raw
In response to autocommit to off?  (Bricklen <bricklen-rem@yahoo.comz>)
List pgsql-general
Bricklen wrote:
> Hi all,
>
> I've scoured the net for a simple way to set AUTOCOMMIT off in psql, for
> the duration of a session (not simply a transaction). The only real
> reference that I can find says that "\set autocommit off" will do what I
> want. It doesn't though. For example, if session A inserts a row, then
> session B has access to that data immediately (from another terminal).
>
> I realize that you can fire off a begin/end pair for every statement,
> but I'm looking for something more global.
>
> Oracle's SQL*Plus is what I'm used to, which is the reason that I'm asking.
>
> Feel free to correct any (mis)understandings I have of psql.

Use uppercase, \set AUTOCOMMIT off

    test=> \set AUTOCOMMIT off
    test=> select 1;
     ?column?
    ----------
            1
    (1 row)

    test=> select 2;
     ?column?
    ----------
            2
    (1 row)

    test=> commit;
    COMMIT

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: mbc@soliton.com
Date:
Subject: clarification of postgres limitations
Next
From: "Leo Sutic"
Date:
Subject: RH7.3 / PGSQL7.4.1 binary distribution