GoogleCloudPlatform / GoogleCloudPlatform/spanner-migration-tool
data and schema migrations fails for source=postgresql due to a field named "order"
- 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
Assessment
This issue has not been assessed yet.