GoogleCloudPlatform/spanner-migration-tool

data and schema migrations fails for source=postgresql due to a field named "order"

muhammadsherief24 opened this issue · 0 comments

Expected Behavior

Schema and data migration succeeds for source=postgresql and target dialect=postgresql for fields with the name order.

Actual Behavior

Schema and data migration fails for source=postgresql and target dialect=postgresql when there is a field named order.

Guess

Field names for postgresql should be surrounded by ".

Steps to Reproduce the Problem

  1. Create a table with the a field named order in a cloud SQL postgresql database.
  2. pg_dump the database: pg_dump -U <user> -h <host> -p <port> <db_name> -n public --format=p > pg_dump.txt.
  3. Run harbourbridge schema-and-data -source=postgresql -target-profile="dialect=postgresql" < pg_dump.txt.
  4. Error
can't migrate database: can't create/update database: can't create database: can't build UpdateDatabaseDdlRequest: rpc error: code = InvalidArgument desc = [ERROR] syntax error at or near \"order\"; failed to parse the DDL statements."}

Specifications

  • Version:
  • Platform: Ubuntu 20 LTS Linux 5.15.0-58-generic