philipsoutham / py-mysql2pgsql

Tool for migrating/converting from mysql to postgresql.
http://packages.python.org/py-mysql2pgsql/
MIT License
455 stars 169 forks source link

Handling of BINARY(1) columns #43

Open gms8994 opened 10 years ago

gms8994 commented 10 years ago

We have a table with a column defined as BINARY(1). This doesn't seem to be defined currently. This should probably just be an int4 column.

Thoughts?

gms8994 commented 10 years ago

It looks like line 58 of postgres_writer.py should be

elif column['type'] == 'tinyint' or column['type'].startswith('binary('):
kworr commented 10 years ago

I'm not that familiar with width in MySQL, I'll take some time to study this...

jeffreydwalter commented 9 years ago

binary(1) should probably be converted to bytea(1).

The defined behavior is pretty much identical between the two: https://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html http://www.postgresql.org/docs/9.0/static/datatype-binary.html