Re: Continue transactions after errors in psql - Mailing list pgsql-patches

From Michael Paesold
Subject Re: Continue transactions after errors in psql
Date
Msg-id 005201c522f2$ec8a16f0$0a01a8c0@zaphod
Whole thread Raw
In response to Re: Continue transactions after errors in psql  ("Greg Sabino Mullane" <greg@turnstep.com>)
Responses Re: Continue transactions after errors in psql  ("Greg Sabino Mullane" <greg@turnstep.com>)
Re: Continue transactions after errors in psql  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Greg Sabino Mullane wrote:

> Finally had a chance to sit down at look at this afresh, and I'm
> pretty sure I've got all the kinks worked out this time. Apologies
> for not attaching, but my mail system is not working well enough
> at the moment. So, please try to break this patch:
>
> http://www.gtsm.com/pg/psql_error_recovery.diff


Some suggestions in random order:

* I think you should use PSQLexec instead of using PQexec directly. PSQLexec
is used by all \-commands and prints out queries with -E, which is very
helpful for debugging.

  -E         display queries that internal commands generate

* You do not check for the server version before activating \reseterror.
  -> use PQserverVersion() to check for >= 80000

* Perhaps the name should be \reseterrors (plural)? Just my personal opinion
though.

* If I read the code correctly, you now don't destroy user savepoints
anymore, but on the other hand, you do not release the psql savepoint after
a user-defined savepoint is released. In other words, each time a user
creates a savepoint, one psql savepoint is left on the subxact stack. I
don't know if this is a real problem, though.

* You have not yet implemented a way to savely put \reseterror in .psqlrc. I
previously suggested an AUTO setting (additional to ON/OFF) that disables
\reseterror when reading from a non-tty. So putting \reseterror AUTO in
.psqlrc would be save.

Otherwise, I could not find a way to break it. :-)

Best Regards,
Michael Paesold


pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Faster install-sh in C
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] Implementation of SQLCODE and SQLERRM variables for