Re: Automatic transactions in psql - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: Automatic transactions in psql
Date
Msg-id Pine.LNX.4.30.0202061913070.682-100000@peter.localdomain
Whole thread Raw
In response to Automatic transactions in psql  ("Greg Sabino Mullane" <greg@turnstep.com>)
Responses Re: Automatic transactions in psql
List pgsql-patches
Greg Sabino Mullane writes:

> The attached patch actually does two related things. First,
> it keeps track of whether or not you are in a trnasaction
> and modifies the prompt slightly when you are by putting
> an asterick at the very front of it.

This is an interesting idea, although you may want to give the user the
option to customize his prompt.  Add an escape, maybe %* or %t, with the
meaning "resolves to * if in a transaction block and to the empty string
if not".  (The existing escapes were all stolen from tcsh, so look there
if you need an idea.)

> Secondly, it adds a "begin transaction" option that, when
> enabled, ensures that you are always inside a transaction
> while in psql, so you can always rollback.

This should be done in the backend.

--
Peter Eisentraut   peter_e@gmx.net


pgsql-patches by date:

Previous
From: Justin Clift
Date:
Subject: Re: contrib/pg_filedump - PostgreSQL File Dump Utility
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Automatic transactions in psql