Re: It looks like transaction, but it isn't transaction - Mailing list pgsql-general

From Tom Lane
Subject Re: It looks like transaction, but it isn't transaction
Date
Msg-id 25585.1251336356@sss.pgh.pa.us
Whole thread Raw
In response to Re: It looks like transaction, but it isn't transaction  (Sergey Samokhin <prikrutil@gmail.com>)
Responses Re: It looks like transaction, but it isn't transaction  (Sergey Samokhin <prikrutil@gmail.com>)
List pgsql-general
Sergey Samokhin <prikrutil@gmail.com> writes:
> I should rejig my question: is this normal for a query made up from
> several commands to be completely discarded if an error occurs?

Yes, if it's submitted as a single Query message, that's what happens.
Also, the implicit transaction is around the whole Query message not
just single SQL statements, which probably explains your confusion
on other points.

There's been some discussion of disallowing multiple statements per
Query, partially to avoid these sorts of corner cases and partially
as a defense against SQL-injection attacks.  But so far the conclusion
has been that it would break a lot of code while not buying much.

            regards, tom lane

pgsql-general by date:

Previous
From: Sergey Samokhin
Date:
Subject: Re: It looks like transaction, but it isn't transaction
Next
From: Craig Ringer
Date:
Subject: Re: PG 8.2 instal on Win2k3 - unable to connect to test network socket