Re: Feature discussion: Should syntax errors abort a transaction? - Mailing list pgsql-general

From Tom Lane
Subject Re: Feature discussion: Should syntax errors abort a transaction?
Date
Msg-id 4867.1340086857@sss.pgh.pa.us
Whole thread Raw
In response to Feature discussion: Should syntax errors abort a transaction?  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: Feature discussion: Should syntax errors abort a transaction?
Re: Feature discussion: Should syntax errors abort a transaction?
List pgsql-general
Craig Ringer <craig@postnewspapers.com.au> writes:
> I've been working in psql a lot recently, and have started to wonder why
> statements with syntax errors or other problems that render them
> unexecutable terminate the transaction.

Well, the obvious reason is that it's hard to tell what the user meant,
so bailing is the safest response.

> I understand why statements that raise errors during their execution
> terminate a transaction,

So you're suggesting that "SELECT 1/0;" should terminate a transaction,
but "SELECT 1//0;" should not?  How about "ROLBACK;"?  It gets pretty
squishy pretty fast when you try to decide which sorts of errors are
more important than others.

            regards, tom lane

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Feature discussion: Should syntax errors abort a transaction?
Next
From: Stefan Schwarzer
Date:
Subject: Re: How to include Tablefunc as an extension