| From: | JPLapham <lapham(at)jandr(dot)org> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Using the database to validate data |
| Date: | 2015-07-24 13:55:10 |
| Message-ID: | 1437746110360-5859239.post@n5.nabble.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Scott Marlowe | 2015-07-24 14:25:09 | Re: Delete rule does not prevent truncate |
| Previous Message | JPLapham | 2015-07-24 13:51:32 | Re: Using the database to validate data |