3 ms·
This is one of the many reasons I prefer postgres, but it's worth noting that even in postgres, there are some DDL statements that cannot be executed within a t
by developer2 9y ago
This is one of the many reasons I prefer postgres, but it's worth noting that even in postgres, there are some DDL statements that cannot be executed within a transaction. I can't remember the list, but they do exist - it's just a far smaller number compared to MySQL.
- adrianmsmith 9y agoFor example adding a value to an enum type: https://www.postgresql.org/docs/9.6/static/sql-altertype.html https://www.postgresql.org/docs/9.6/static/sql-altertype.htm... (This bit me recently, because our database migration framework (correctly) puts transactions around migrations, and PostgreSQL (correctly) fails with an error in the case you try to do an operation in a transaction which can't be done in a transaction. (I say correctly, as opposed to Oracle/MySQL which will silently do commits etc.))
- emeijer 9y agoActually, as of the next version (10) you can :)
- pritambaral 9y agoI have been in this situation. I then wondered if it was indeed right for my database migration tool to forcibly wrap migrations in transactions and not let me override that behaviour.