PostgreSQL ALTER TABLE has a very nifty ALTER COLUMN USING expression syntax, that allow flexible column conversion.
We should use that in DatabaseSchema_pgsql::changeField() instead of the hackish "rename the old field to _old, copy the data over, drop the old field" method that we are currently using.
Comments
Comment #1
damien tournoud commentedThinking about this more, it seems that ALTER COLUMN only supports a subset of what we need. The current solution is more robust. Let's reconsider this for Drupal 8.
Comment #2
jhedstromComment #3
bzrudi71 commentedComment #4
nod_how is that ajax?
Comment #5
bzrudi71 commentedThis has for sure nothing to do with ajax ;-)
Comment #6
bzrudi71 commentedI don't see much room for improvements here. Using expression syntax is very limited (as already stated in #1) and some things changed meanwhile. Leaving this open for discussion and will close this if we have not other feedback in a couple of days...
Comment #7
bzrudi71 commentedLet's close this one now :)