Re: Using the database to validate data - Mailing list pgsql-general

From JPLapham
Subject Re: Using the database to validate data
Date
Msg-id 1437746110360-5859239.post@n5.nabble.com
Whole thread Raw
In response to Re: Using the database to validate data  (Zdeněk Bělehrádek<zdenek.belehradek@superhosting.cz>)
Responses Re: Using the database to validate data  (Adam Brusselback <adambrusselback@gmail.com>)
List pgsql-general
Zdeněk Bělehrádek wrote
> What about creating a SAVEPOINT before each INSERT, and if the INSERT
> returns
> an error, then ROLLBACK TO SAVEPOINT? This way you will have all the
> insertable data in your table, and you can still ROLLBACK the whole
> transaction, or COMMIT it if there were no errors.
>
> It will probably be quite slow, but if you have only thousands of lines,
> it
> should be fast enough for your usecase IMHO.
>
> -- Zdeněk Bělehrádek

Hmmm, interesting. Thanks, if that works, it would be exactly what I'm
looking for!

You are right, speed is not an issue.

-Jon



--
View this message in context: http://postgresql.nabble.com/Using-the-database-to-validate-data-tp5859046p5859239.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: JPLapham
Date:
Subject: Re: Using the database to validate data
Next
From: Alejandro Taboada
Date:
Subject: BDR Error on Debian wheezy packages