GoogleCloudPlatform / GoogleCloudPlatform/spanner-migration-tool

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

Open
#450 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PLpgSQL
Stars
155
Forks
83
Avg merge
3d 7h
Merged PRs (30d)
6

Description

## 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 -h -p -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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.