Re: Using the database to validate data

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Zdeněk Bělehrádek <zdenek(dot)belehradek(at)superhosting(dot)cz>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using the database to validate data
Date: 2015-07-24 17:07:00
Message-ID: CAMkU=1yKiroBsgEjJHPjTsc4GLP13XtrXyy4gLu=For_JvHkZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 24, 2015 at 5:17 AM, Zdeněk Bělehrádek <
zdenek(dot)belehradek(at)superhosting(dot)cz> wrote:

> What about creating a SAVEPOINT before each INSERT, and if the INSERT
> returns
> an error, then ROLLBACK TO SAVEPOINT?

Make sure you release the savepoint if there was no error. Otherwise you
will quickly run out of memory.

Also, if there was an error, then after rolling back to the savepoint
either release it, or refrain from starting a new one at the beginning of
the next insert.

Cheers,

Jeff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2015-07-24 18:06:10 Re: Delete rule does not prevent truncate
Previous Message Chris Withers 2015-07-24 16:59:03 pgbench tps drop from 5000 to 37 going from localhost to a server 13ms away