X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A63A19FB20D for ; Thu, 27 Jul 2006 16:35:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 44221-04 for ; Thu, 27 Jul 2006 16:35:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from alvh.no-ip.org (200-126-100-4.bk7-dsl.surnet.cl [200.126.100.4]) by postgresql.org (Postfix) with ESMTP id 0717B9FA5FC for ; Thu, 27 Jul 2006 16:35:21 -0300 (ADT) Received: by alvh.no-ip.org (Postfix, from userid 1000) id 4211FC2F85A; Thu, 27 Jul 2006 15:35:20 -0400 (CLT) Date: Thu, 27 Jul 2006 15:35:20 -0400 From: Alvaro Herrera To: Mark Lewis Cc: pgsql-performance@postgresql.org Subject: Re: Savepoint performance Message-ID: <20060727193520.GG18774@surnet.cl> Mail-Followup-To: Mark Lewis , pgsql-performance@postgresql.org References: <1154020755.1634.509.camel@archimedes> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1154020755.1634.509.camel@archimedes> User-Agent: Mutt/1.5.12-2006-07-14 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.784 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FORGED_RCVD_HELO, RCVD_IN_SORBS_DUL, RCVD_IN_XBL X-Spam-Level: **** X-Archive-Number: 200607/248 X-Sequence-Number: 20108 Mark Lewis wrote: > So my question is, how expensive is setting a savepoint in PG? If it's > not too expensive, I'm wondering if it would be feasible to add a config > parameter to psql or other client interfaces (thinking specifically of > jdbc here) to do it automatically. Doing so would make it a little > easier to work with PG in a multi-db environment. It is moderately expensive. It's cheaper than starting/committing a transaction, but certainly much more expensive than not setting a savepoint. In psql you can do what you want using \set ON_ERROR_ROLLBACK on. This is clearly a client-only issue, so the server does not provide any special support for it (just like autocommit mode). -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support