Showing results for 
Search instead for 
Did you mean: 

MTK:DB-42601: ERROR: syntax error at or near "-" at position 21

DB-42601: ERROR: syntax error at or near "-" at position 21
-- Line 1: CREATE SCHEMA mantis-mtsn;
-- ^



One or more schema objects could not be imported during the migration process. 




From the error itself it's clear that the schema-name format is not supported in Postgres.


To perform the migration successfully it's recommended to proceed with the offline migration.


When the offline migration script will be generated, one can manually change the schema name like below:


postgres=# CREATE SCHEMA "mantis-mtsn";


Below is the test case which was conducted:


psql.bin (10.5)

Type "help" for help.


postgres=# CREATE SCHEMA mantis-mtsn

postgres-# ;

ERROR:  syntax error at or near "-"

LINE 1: CREATE SCHEMA mantis-mtsn


postgres=# CREATE SCHEMA "mantis-mtsn";


postgres=# \dn

    List of schemas

    Name     |  Owner   


mantis-mtsn | postgres

public      | postgres

(2 rows)


We see in the above example that thorugh offline migration the schema was successfully migrated from mysql to postgres.

Version history
Revision #:
3 of 3
Last update:
‎03-24-2019 11:15 AM
Updated by: