py-mysql2pgsql icon indicating copy to clipboard operation
py-mysql2pgsql copied to clipboard

Handling of BINARY(1) columns

Open gms8994 opened this issue 12 years ago • 3 comments

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 avatar Nov 04 '13 15:11 gms8994

It looks like line 58 of postgres_writer.py should be

elif column['type'] == 'tinyint' or column['type'].startswith('binary('):

gms8994 avatar Nov 04 '13 17:11 gms8994

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

kworr avatar Nov 05 '13 15:11 kworr

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

jeffreydwalter avatar Jul 28 '15 17:07 jeffreydwalter