Can one (repeatedly) restructure a Firebird table in a single transaction?

孤街浪徒 提交于 2020-01-26 04:07:04

问题


Normally, I'd do a relatively complicated change of data type on column A like this:

  • Create column B of the new data type
  • Set B to contain the new values derived from A
  • Drop A
  • Rename B to A

To guarantee the validity of my data model, I'd like to perform such restructuring within a single transaction. So far, I have not been able to do that, because, depending on the isolation level, either B is not considered to exist yet, or I'm not allowed to rename B ("update conflicts with concurrent update"), or no errors occur but B is empty. Is it possible to perform to do what I ask - I'd love to see how - or is it absolutely required to COMMIT in between?


回答1:


After searching using apparently more appropriate search terms (metadata), as well as via de Firebird support groups, I found that this is clearly not possible. The workaround is to do the migration in steps and combine it with backups (never a bad idea).



来源:https://stackoverflow.com/questions/15591799/can-one-repeatedly-restructure-a-firebird-table-in-a-single-transaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!