Re: Savepoint performance - Mailing list pgsql-performance

From Alvaro Herrera
Subject Re: Savepoint performance
Date
Msg-id 20060727193520.GG18774@surnet.cl
Whole thread Raw
In response to Savepoint performance  (Mark Lewis <mark.lewis@mir3.com>)
Responses Re: Savepoint performance  ("Denis Lussier" <denisl@enterprisedb.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Ioana Danes
Date:
Subject: Re: Query plan issue when upgrading to postgres 8.14 (from
Next
From: Tom Lane
Date:
Subject: Re: performance issue with a specific query