philipsoutham/py-mysql2pgsql — pull request #51 by akinsgre (2013-11-29 15:57:22+00:00)
Title: GH-40 Adding longblob with column['type'] = longblob, blob binary, varbi...

Using @desfrenes suggestion from GH-40. I experience issues migrating a MySQL database with longblob fields and this solved the issue demonstrated in the following backtrace

START CREATING TABLES
START - CREATING TABLE aboveground_tank_attachments
Traceback (most recent call last):
File "/Users/gakins/Projects/python/py-mysql2pgsql/bin/py-mysql2pgsql", line 38, in
mysql2pgsql.Mysql2Pgsql(options).convert()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/mysql2pgsql.py", line 31, in convert
Converter(reader, writer, self.file_options, self.run_options.verbose).convert()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/converter.py", line 31, in convert
self.writer.write_table(table)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/__init__.py", line 86, in decorated_function
ret = f(*args, **kwargs)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/postgres_db_writer.py", line 152, in write_table
table_sql, serial_key_sql = super(PostgresDbWriter, self).write_table(table)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/postgres_writer.py", line 213, in write_table
primary_keys, serial_key, maxval, columns = self.table_attributes(table)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/postgres_writer.py", line 189, in table_attributes
columns.write(' %s,\n' % self.column_description(column))
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/postgres_writer.py", line 26, in column_description
return '"%s" %s' % (column['name'], self.column_type_info(column))
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/postgres_writer.py", line 126, in column_type_info
default, column_type = get_type(column)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py_mysql2pgsql-0.1.6-py2.7.egg/mysql2pgsql/lib/postgres_writer.py", line 124, in get_type
raise Exception('unknown %s' % column['type'])
Exception: unknown longblob