Re: [HACKERS] Continue transactions after errors in psql

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Continue transactions after errors in psql
Date: 2005-04-26 12:22:03
Message-ID: 004d01c54a5a$8e38db10$6f01a8c0@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Greg Sabino Mullane wrote:
> To reiterate my opinion, I think the behavior should be the same
> for interactive and non-interactive sessions. Not only will it
> prevent nasty surprises, but unless we make a third 'setting',
> there will be no way to enable this in non-interactive scripts,
> which is something that I would want to be able to do.
>
> > I don't buy the "but what if I set it in .psqlrc and forget" argument.
> That could be applied to a lot of things you could put in there. This
> setting defaults to "off" and must be explicitly enabled. I'd be okay
> with a "smart" mode that explicitly enables the
> interactive/non-interactive
> split.

But people (like me for example) will want to enable this behaviour by
default. So they (me too) will put the option in .psqlrc. It is then enabled
"by default". But then many of my scripts will destroy data instead of just
erroring out.
I just don't see why non-interactive mode does need such a switch because
there is no way to check if there was an error. So just put two queries
there and hope one will work?

If you really want this for scripts, there must be two options:
* one to put savely into .psqlrc (what some people will want, I have \set
AUTOCOMMIT off in my .psqlrc file, too, and I know I am not the only one)
* another one that will also work in scripts

I hope you understand and accept the issue here.

Best Regards,
Michael Paesold

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Huxton 2005-04-26 14:05:53 Re: [HACKERS] Continue transactions after errors in psql
Previous Message Pavel Stehule 2005-04-26 12:05:59 Re: bitmapscan test, no success, again

Browse pgsql-patches by date

  From Date Subject
Next Message Richard Huxton 2005-04-26 14:05:53 Re: [HACKERS] Continue transactions after errors in psql
Previous Message Greg Sabino Mullane 2005-04-26 11:43:31 Re: [HACKERS] Continue transactions after errors in psql