Re: Does psql use nested transactions?

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Philip Warner" <pjw(at)rhyme(dot)com(dot)au>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Does psql use nested transactions?
Date: 2004-08-11 15:12:33
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3412A744A@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> In 8.0 beta 1 I just tried:
>
> psql template1
> > begin;
> > select * from pg_class;
> ... got stuff ...
> > select * from aaa;
> ERROR: relation "zzz" does not exist
> > select * from pg_class;
> ERROR: current transaction is aborted....
>
> Should psql run every statement in a nested transaction and only
rollback
> that TX? Or is that not possible/desirable. If possible, this would be
a
> *great* feature for those of use prone to mis-spellings.

Nested transactions are not designed to help you with spelling errors.
They are designed to give you more flexible options with rolling back
data to keep it in a valid state.

psql is designed to follow the same logical statement progression as any
other connection to the database. Your suggestion could muck up sql
scripts piped through it to the database.

If you make a lot of spelling errors, just macro 'savepoint x' and fire
that when typing multiple related statements into psql after each
statement.

Merlin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-08-11 15:16:26 Re: Release notes for upgrading
Previous Message Stephan Szabo 2004-08-11 15:06:09 Re: Add Missing From?