Re: Oracle vs PG

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Ravi Krishna <srkrishna1(at)aol(dot)com>, adrian(dot)klaver(at)aklaver(dot)com
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Oracle vs PG
Date: 2018-10-24 05:31:57
Message-ID: b02f6c98fe38d93ade32eaa8fa5c681355a26e8a.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 typically used
> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Boris Sagadin 2018-10-24 05:39:44 Re: Postgres 10, slave not catching up with master
Previous Message Bruno Wolff III 2018-10-24 01:23:14 Should pg 11 use a lot more memory building an spgist index?