Re: It looks like transaction, but it isn't transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergey Samokhin <prikrutil(at)gmail(dot)com>
Cc: Sam Mason <sam(at)samason(dot)me(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: It looks like transaction, but it isn't transaction
Date: 2009-08-27 01:25:56
Message-ID: 25585.1251336356@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Samokhin <prikrutil(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2009-08-27 01:55:17 Re: PG 8.2 instal on Win2k3 - unable to connect to test network socket
Previous Message Sergey Samokhin 2009-08-27 00:36:36 Re: It looks like transaction, but it isn't transaction