Re: Continue transactions after errors in psql

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Continue transactions after errors in psql
Date: 2005-03-07 08:51:49
Message-ID: 005201c522f2$ec8a16f0$0a01a8c0@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2005-03-07 09:28:57 Re: [HACKERS] Implementation of SQLCODE and SQLERRM variables for
Previous Message Josh Berkus 2005-03-07 05:12:03 Re: buildfarm issues

Browse pgsql-patches by date

  From Date Subject
Next Message Pavel Stehule 2005-03-07 09:28:57 Re: [HACKERS] Implementation of SQLCODE and SQLERRM variables for
Previous Message Alvaro Herrera 2005-03-07 04:22:52 Re: Faster install-sh in C