Re: Oracle vs PG - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Oracle vs PG
Date
Msg-id b02f6c98fe38d93ade32eaa8fa5c681355a26e8a.camel@cybertec.at
Whole thread Raw
In response to Re: Oracle vs PG  (Ravi Krishna <srkrishna1@aol.com>)
Responses Re: Oracle vs PG  (Michael Paquier <michael@paquier.xyz>)
List pgsql-general
Ravi Krishna wrote:
> I have hardly used savepoints in any application, but if I understand it correctly, isn't it something which is
typicallyused
 
> in a persistent connection.  I wonder how it is applicable in a web based stateless application like Amazon.com,
unless
> even web based application have database level state.

I have seen people use savepoints in PostgreSQL to emulate Oracle's
"statement rollback" behavior: If a statement fails, only the statement
is undone, but the transaction continues.

If you insert a savepoint before *every* statement in a transaction,
you can get a similar behavior in PostgreSQL, but the performance will
suck.

Perhaps that is what happened in this case.

Of course the correct solution is to redesign and use savepoints only
where you *expect* an error, or at least batch a number of statements
with each savepoint.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Should pg 11 use a lot more memory building an spgist index?
Next
From: Boris Sagadin
Date:
Subject: Re: Postgres 10, slave not catching up with master