Re: Feature discussion: Should syntax errors abort a transaction?

From: Rafal Pietrak <rafal(at)zorro(dot)isa-geek(dot)com>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Feature discussion: Should syntax errors abort a transaction?
Date: 2012-06-24 20:37:58
Message-ID: 1340570278.14341.32.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 2012-06-23 at 12:18 +0000, Jasen Betts wrote:
> On 2012-06-19, Rafal Pietrak <rafal(at)zorro(dot)isa-geek(dot)com> wrote:
>
> > And we are talking about interractive psql breaking transaction because
> > of syntax error - almost always this is a one time typo. I'd prefere it
> > to be a bit more "sloopy", then deployed SQL application (e.g.
> > non-interactive session).
>
> possibly you could program keyboard macros to handle savepoints to
> have an easy way to recover from these errors, but if you're working on a

Yes, but again. In my own psql usage, it goes like this: "this is a
simple and easy SQL, most of it was cut/paste anyway .... what could
possibly go wrong .... ups". But it goes wrong in less then every 20th
or 100th time, less then once in a few months. So i don't realy feel
like pushing somebody into a development effort, that woud just slightly
enhance psql comfort of usage. I most certainly want even be cooking any
macros, as .... I would forget to use it when it could be of some help.

My comment on this thread was mearly to object, that a request to allow
maintaining transaction state despite syntax error is "obviusly wrong".

> busy database keeping a transaction open whislt you think about syntax
> is going to cost perfromance for the other users.

And this is a really good point - although I do know my schemas and I
can choose appropriate moment for long hand-opened transation, mistakes
happen (well, this whole thread is about mistakes :)

Anyway, I personaly feel that psql would be more comfortable if one
could request "explicit rollback despite errors" (like by "BEGIN
INTERACTIVE").

-R

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2012-06-25 00:57:45 Re: Hot standby streaming replication doesn't work
Previous Message Craig Ringer 2012-06-24 09:09:41 Re: configuring queries for concurrent updates