4 ms·
Exactly. IMHO Postgres (and other SQL DBs) should consider making SERIALIZABLE the default (as is specified in ANSI SQL). Otherwise people try to be clever.
by jasonhansel 5y ago
Exactly. IMHO Postgres (and other SQL DBs) should consider making SERIALIZABLE the default (as is specified in ANSI SQL). Otherwise people try to be clever.
- lucian1900 5y agoNot only is that slow, but it raises errors programs aren’t currently handing. It would be incompatible to change.
- belter 5y agoAs opposed to the current default, that also raises errors programmers aren’t currently handing :-)
- lucian1900 5y agoThe current default has effect anomalies, but doesn't raise serialization errors. It's possible to write software that relies on READ COMMITTED and behaves correctly.
- hgdfadsfwer 5y agoANSI default is READ COMMITTED I believe.
- stubish 5y agoA program using SERIALIZABLE transaction isolation is required to handle the inevitable errors on commit and retry the transaction or roll back the operation. In practice, developers rarely do and you end up with webapps spitting out 50x errors under load and people blaming the database because they didn't read the fine print. Which is why some projects like psycopg which did default to SERIALIZABLE transaction isolation ended up switching to READ COMMITTED as a more sensible default. It is rare that people actually need SERIALIZABLE and they rarely want to pay the performance or development costs.
- skyde 5y agoYou say it is rare that people need serializable. But I would say majority of code that handle money need to use explicit lock or serializable otherwise they can easily be exploited by hacker to get thing for free.