Bug #71121 Postgres To MySQL migration failed
Submitted: 9 Dec 2013 17:53 Modified: 2 Jun 2016 23:48
Reporter: Christian Munsayac Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Migration Severity:S2 (Serious)
Version:5.6 OS:Windows
Assigned to: CPU Architecture:Any

[9 Dec 2013 17:53] Christian Munsayac
Description:
I'm migrating Postgres database that is coming from different host Red Hat Server (RHEL 5) to my machine hosting MySQL Server (Windows 7). During migration I encountered this problem regarding "pg_catalog.pg_enum does not exist". I know you might ask me question regarding modifying db_postgresql_re_grt.py as suggested in BUG #68997, just so you know its already added.

http://bugs.mysql.com/bug.php?id=68997

However with this line added I still get errors below:

Starting...

Connect to source DBMS...

- Connecting...

Connecting to postgresql@DRIVER=PostgreSQL ANSI;SERVER=OPCHUX0032;PORT=5432...

Opening ODBC connection to DRIVER=PostgreSQL ANSI;SERVER=OPCHUX0032;PORT=5432;DATABASE=reviewboard;UID=reviewboard...

Connected

Connect to source DBMS done

Reverse engineer selected schemata....

Reverse engineering public from reviewboard

- Reverse engineering catalog information

Traceback (most recent call last):

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\modules\db_postgresql_re_grt.py", line 335, in reverseEngineer

    return PostgresqlReverseEngineering.reverseEngineer(connection, catalog_name, schemata_list, context)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\modules\db_generic_re_grt.py", line 228, in reverseEngineer

    catalog = cls.reverseEngineerCatalog(connection, catalog_name)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\modules\db_generic_re_grt.py", line 379, in reverseEngineerCatalog

    cls.reverseEngineerUserDatatypes(connection, catalog)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\modules\db_postgresql_re_grt.py", line 236, in reverseEngineerUserDatatypes

    enum_types = cls.execute_query(connection, query_enums if version.majorNumber >= 9 and version.minorNumber >= 1 else query_enums_80)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\modules\db_generic_re_grt.py", line 76, in execute_query

    return cls.get_connection(connection_object).cursor().execute(query, *args, **kwargs)

pyodbc.ProgrammingError: ('42P01', '[42P01] ERROR: relation "pg_catalog.pg_enum" does not exist;\nError while executing the query (7) (SQLExecDirectW)')

Traceback (most recent call last):

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\workbench\wizard_progress_page_widget.py", line 192, in thread_work

    self.func()

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\modules\migration_schema_selection.py", line 160, in task_reveng

    self.main.plan.migrationSource.reverseEngineer()

  File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.7\modules\migration.py", line 335, in reverseEngineer

    self.state.sourceCatalog = self._rev_eng_module.reverseEngineer(self.connection, self.selectedCatalogName, self.selectedSchemataNames, self.state.applicationData)

SystemError: ProgrammingError("('42P01', '[42P01] ERROR: relation "pg_catalog.pg_enum" does not exist;\nError while executing the query (7) (SQLExecDirectW)')"): error calling Python module function DbPostgresqlRE.reverseEngineer

ERROR: Reverse engineer selected schemata: ProgrammingError("('42P01', '[42P01] ERROR: relation "pg_catalog.pg_enum" does not exist;\nError while executing the query (7) (SQLExecDirectW)')"): error calling Python module function DbPostgresqlRE.reverseEngineer

Failed

Can someone help me out to get pass thru?
Any assistance is greatly appreciated.

Regards,
Christian

How to repeat:
Start MySQL Workbench Migration >> supply all credentials for emote PostgreSQL server as source >> supply all credentials for local MySQL server as target >> Test Both Connections >> Select Schema Database to migrate >> And after clicking next to REVERSE ENGINEER the database, it FAILED.
[24 Jan 2014 12:23] Alfredo Kojima
What version of postgres?
[25 Feb 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[26 Mar 2014 9:18] Gerrit Bagschik
Hello there,

i found the same bug, using PostgreSQL 8.1

Regards,

Gerrit
[23 Feb 2015 7:32] YoungLea Lee
I find same error! 
Postgresql version is 8.2 
That postgresql don't have "pg_catalog.pg_enum" table.
So, How can I do for this error?
[6 Aug 2015 3:55] Ronel Cabrera
I have encountered this also. Can anyone give us the solution for this? PSQL Version used is 8.2
[12 Feb 2016 13:51] Milosz Bodzek
Aplly this patch and try again. Let me know if that help

Attachment: bug71121.diff (text/x-patch), 4.56 KiB.

[2 Jun 2016 23:48] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.7 release, and here's the changelog entry:

The PostgreSQL migration wizard could fail with an "pg_catalog.pg_enum
does not exist" error.

Thank you for the bug report.