EndPointCorp / end-point-blog

End Point Dev blog
https://www.endpointdev.com/blog/
17 stars 65 forks source link

Comments for Postgres ON_ERROR_ROLLBACK explained #1094

Open phinjensen opened 6 years ago

phinjensen commented 6 years ago

Comments for https://www.endpointdev.com/blog/2015/02/postgres-onerrorrollback-explained/ By Greg Sabino Mullane

To enter a comment:

  1. Log in to GitHub
  2. Leave a comment on this issue.
phinjensen commented 6 years ago
original author: Noah
date: 2015-04-02T14:45:12-04:00

This is a very neat feature.

I don't understand this, though: "Normally, any error you make will throw an exception and cause your current transaction to be marked as aborted. This is sane and expected behavior..."

No, it's really not. Oracle doesn't work this way, nor does MySQL. I have no experience with MSSQL or DB2 but I'll bet a dollar each they don't work this way either. There no intuitive reason why a syntax error, or any other error for that matter, should abort a transaction. I can only assume there's either some limitation deep in the Postgres guts that requires this behavior, or that it conforms to some obscure part of the SQL standard that everyone else sensibly ignores. There's certainly no API / UX reason why it should work this way.

We really shouldn't be too proud of any workarounds we've developed for this pathological behavior. It's like IT Stockholm Syndrome.

phinjensen commented 6 years ago
original author: PAscal
date: 2016-01-15T16:46:28-05:00

Hi, this auto-savepoint feature as also been included into SQLeo (http://sqleo.sourceforge.net/index.html) starting with 2015.12 release.

Thanks for this Idea