Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2012-08-17 Thread Ross Reedstrom
On Wed, Aug 15, 2012 at 10:26:55PM -0400, Bruce Momjian wrote: On Mon, Nov 14, 2011 at 04:19:30PM -0600, Ross Reedstrom wrote: On Wed, Sep 28, 2011 at 11:47:51AM -0700, David Fetter wrote: On Wed, Sep 28, 2011 at 02:25:44PM -0400, Gurjeet Singh wrote: On Wed, Sep 28, 2011 at 1:51 PM,

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2012-08-16 Thread Daniel Farina
On Mon, Nov 14, 2011 at 3:05 PM, Ross Reedstrom reeds...@rice.edu wrote: On Mon, Nov 14, 2011 at 02:45:04PM -0800, Will Leinweber wrote: My coworker Dan suggested that some people copy and paste scripts. However I feel that that is an orthogonal problem and if there is a very high rate of

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2012-08-15 Thread Bruce Momjian
On Mon, Nov 14, 2011 at 04:19:30PM -0600, Ross Reedstrom wrote: On Wed, Sep 28, 2011 at 11:47:51AM -0700, David Fetter wrote: On Wed, Sep 28, 2011 at 02:25:44PM -0400, Gurjeet Singh wrote: On Wed, Sep 28, 2011 at 1:51 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote:

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-11-14 Thread Ross Reedstrom
On Wed, Sep 28, 2011 at 11:47:51AM -0700, David Fetter wrote: On Wed, Sep 28, 2011 at 02:25:44PM -0400, Gurjeet Singh wrote: On Wed, Sep 28, 2011 at 1:51 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Alvaro Herrera alvhe...@commandprompt.com wrote: See ON_ERROR_ROLLBACK

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-11-14 Thread Ross Reedstrom
On Mon, Nov 14, 2011 at 02:45:04PM -0800, Will Leinweber wrote: My coworker Dan suggested that some people copy and paste scripts. However I feel that that is an orthogonal problem and if there is a very high rate of input psql should detect that and turn interactive off. And I still strongly

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-11-14 Thread Will Leinweber
My coworker Dan suggested that some people copy and paste scripts. However I feel that that is an orthogonal problem and if there is a very high rate of input psql should detect that and turn interactive off. And I still strongly feel that on_error_rollback=interactive should be the default.

[HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Will Leinweber
I ruined a 5 hour UPDATE by typoing a table name on a SELECT to verify the update worked. I suppose I have no one else to blame, but it was really frustrating, to say the least. I assume this has happened to others as well. I only later found out about SAVEPOINT, which I immediately ran the next

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Gurjeet Singh
On Tue, Sep 27, 2011 at 7:57 PM, Will Leinweber w...@heroku.com wrote: I ruined a 5 hour UPDATE by typoing a table name on a SELECT to verify the update worked. I suppose I have no one else to blame, but it was really frustrating, to say the least. I assume this has happened to others as

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Marko Tiikkaja
On 28/09/2011 02:57, Will Leinweber wrote: psql console, while in a transaction, and while in interactive mode, should savepoint for me. You are lucky, since that feature has been in psql for some time already. Simply add this to your .psqlrc: \set ON_ERROR_ROLLBACK on -- Marko Tiikkaja

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Alvaro Herrera
Excerpts from Will Leinweber's message of mar sep 27 20:57:52 -0300 2011: I ruined a 5 hour UPDATE by typoing a table name on a SELECT to verify the update worked. I suppose I have no one else to blame, but it was really frustrating, to say the least. I assume this has happened to others as

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Kevin Grittner
Gurjeet Singh singh.gurj...@gmail.com wrote: Will Leinweber w...@heroku.com wrote: I ruined a 5 hour UPDATE by typoing a table name on a SELECT to verify the update worked. Ouch! I normally use tab-completion or copy/paste to save myself from myself in such situations. I only later

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Kevin Grittner
Alvaro Herrera alvhe...@commandprompt.com wrote: See ON_ERROR_ROLLBACK http://www.postgresql.org/docs/9.0/static/app-psql.html I had missed that. Dang, this database product is rich with nice features! :-) -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Gurjeet Singh
On Wed, Sep 28, 2011 at 1:51 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Alvaro Herrera alvhe...@commandprompt.com wrote: See ON_ERROR_ROLLBACK http://www.postgresql.org/docs/9.0/static/app-psql.html I had missed that. Dang, this database product is rich with nice features!

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread David Fetter
On Wed, Sep 28, 2011 at 02:25:44PM -0400, Gurjeet Singh wrote: On Wed, Sep 28, 2011 at 1:51 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Alvaro Herrera alvhe...@commandprompt.com wrote: See ON_ERROR_ROLLBACK http://www.postgresql.org/docs/9.0/static/app-psql.html I had

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Stephen Frost
* Kevin Grittner (kevin.gritt...@wicourts.gov) wrote: Alvaro Herrera alvhe...@commandprompt.com wrote: See ON_ERROR_ROLLBACK http://www.postgresql.org/docs/9.0/static/app-psql.html I had missed that. Dang, this database product is rich with nice features! :-) Be careful when running

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Alvaro Herrera
Excerpts from Stephen Frost's message of mié sep 28 16:22:58 -0300 2011: Be careful when running scripts, however.. Any invocation of psql will read you .psqlrc and if you've got ON_ERROR_ROLLBACK set there then psql -f blah ; will pick up on that and you'll end up running every command in

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Kevin Grittner
Alvaro Herrera alvhe...@commandprompt.com wrote: ON_ERROR_ROLLBACK [on can be a problem in a script file] So set it to interactive. I think we have an opportunity for a documentation enhancement there. -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Daniel Farina
On Wed, Sep 28, 2011 at 1:02 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Alvaro Herrera alvhe...@commandprompt.com wrote: ON_ERROR_ROLLBACK [on can be a problem in a script file] So set it to interactive. I think we have an opportunity for a documentation enhancement there. In

Re: [HACKERS] feature request: auto savepoint for interactive psql when in transaction.

2011-09-28 Thread Will Leinweber
On Wed, Sep 28, 2011 at 10:39 AM, Marko Tiikkaja marko.tiikk...@2ndquadrant.com wrote:  Simply add this to your .psqlrc: \set ON_ERROR_ROLLBACK on Thank you Marko and Alvaro for pointing me in the right direction. I set it to 'interactive', which I think makes the most sense. I do wish this