Sergey Samokhin <prikrutil@xxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general