Re: Does psql use nested transactions?

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Does psql use nested transactions?
Date: 2004-08-19 11:01:05
Message-ID: 1092913265.19932.74.camel@braydb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2004-08-18 at 02:48, Greg Stark wrote:
> "Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
>
> > This behaviour allows much closer mimicking of Oracle and other RDBMS's
> > transactional behaviour
>
> <begin 2c>This is my single biggest pet peeve with Postgres. When I was first
> starting it was the single most frustrating violation of the "least surprise"
> principle and now that I've been working with it for over a year it's the one
> that most continues to interfere with productive work.
>
> With Oracle I found it *extremely* useful on many occasions when doing manual
> updates to be able to check out the effects of my statements before committing
> them. It also meant I could do several updates or deletes and commit them all
> together.
>
> With Postgres I effectively have to work in autocommit mode. Starting over
> from scratch every time I make a typo is infeasible. It feels like trying to
> type in a C program using "cat". I've done it before but it's not something I
> want to repeat often.

It really isn't necessary to do that. If you are entering commands into
psql manually, either they are so few that you can easily repeat them,
using readline editing, or you can write the commands as a script in an
external file, with BEGIN and END at its top and bottom, and run it with
\i /path/to/file.

If it fails, re-edit it with \!vi /path/to/file and repeat \i

You certainly do not have to work in autocommit mode. It will be nice
to have nested transactions, but this is not the compelling reason for
doing it.

Oliver Elphick

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-08-19 11:21:29 Re: PGPASSWORD and client tools
Previous Message Gaetano Mendola 2004-08-19 10:30:42 Re: Tablespace and cpu costs