Project

General

Profile

« Previous | Next » 

Revision 5398

sql.py: mk_update(): in_place: Convert columns of type character varying to text so that they can be merge-joined with text columns. Note that these two types are equivalent but not aliases of one another, so the explicit type change is needed.

View differences:

sql.py
908 908
    if in_place:
909 909
        assert cond == None
910 910
        
911
        changes = [(c, v, db.col_info(sql_gen.with_default_table(c, table),
912
            cacheable_).type) for c, v in changes]
911
        def col_type(col):
912
            return sql_gen.canon_type(db.col_info(
913
                sql_gen.with_default_table(c, table), cacheable_).type)
914
        changes = [(c, v, col_type(c)) for c, v in changes]
913 915
        query = 'ALTER TABLE '+table.to_str(db)+'\n'
914 916
        query += ',\n'.join(('ALTER COLUMN '+c.to_str(db)+' TYPE '+t+'\nUSING '
915 917
            +v.to_str(db) for c, v, t in changes))

Also available in: Unified diff