Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 96704633E80 for ; Thu, 23 Jul 2009 03:11:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 25124-06 for ; Thu, 23 Jul 2009 03:11:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f217.google.com (mail-gx0-f217.google.com [209.85.217.217]) by mail.postgresql.org (Postfix) with ESMTP id D2C0363289C for ; Thu, 23 Jul 2009 03:11:41 -0300 (ADT) Received: by gxk17 with SMTP id 17so1206273gxk.19 for ; Wed, 22 Jul 2009 23:11:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.31.70 with SMTP id x6mr665520ibc.32.1248329094041; Wed, 22 Jul 2009 23:04:54 -0700 (PDT) In-Reply-To: <4A67F5B6.4080409@archonet.com> References: <4A67F5B6.4080409@archonet.com> Date: Thu, 23 Jul 2009 02:04:53 -0400 Message-ID: Subject: Re: Bit by "commands ignored until end of transaction block" again From: Glenn Maynard To: Richard Huxton Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/106 X-Sequence-Number: 32847 On Thu, Jul 23, 2009 at 1:31 AM, Richard Huxton wrote: >> =C2=A0- Let me use SAVEPOINT outside of a transaction, > > You are never outside a transaction. All queries are executed within a > transaction. "Transaction block", then, if you insist. > I think this is the root of your problem - all queries are within a > transaction so either: > 1. You have a transaction that wraps a single statement. If you get an er= ror > then only that statement was affected. > 2. You have an explicit BEGIN...COMMIT transaction which could use a > savepoint. Savepoints can only be used inside transaction blocks. My function has no idea whether it's being called inside a transaction block.