Trying to transfer from MSSQL to PostgreSQL
I can't make this work. I'm trying to drop the default value for a column because the default value is N'Title and it seems to mess up with the parser.
$ pgloader -V
pgloader version "3.2.2"
compiled with SBCL 1.3.11
LOAD DATABASE
FROM mssql://<user>:<password>@<hostname>/<dbname>
INTO postgresql://postgres:@127.0.0.1/test
WITH schema only, downcase identifiers, quote identifiers
CAST column Page.title when default "N'Title" to Page.title drop default
;
Error:
An unhandled error condition has been signalled: At
LOAD DATABASE
^ (Line 1, Column 0, Position 0)
Could not parse subexpression ";" when parsing
Expression PGLOADER.PARSER::COMMANDS
Subexpression (+ PGLOADER.PARSER::COMMAND)
Subexpression PGLOADER.PARSER::COMMAND
Subexpression (AND
(OR PGLOADER.PARSER::LOAD-ARCHIVE
PGLOADER.PARSER::LOAD-CSV-FILE
PGLOADER.PARSER::LOAD-FIXED-COLS-FILE
PGLOADER.PARSER::LOAD-COPY-FILE
PGLOADER.PARSER::LOAD-DBF-FILE
PGLOADER.PARSER::LOAD-IXF-FILE
PGLOADER.PARSER::LOAD-MYSQL-DATABASE
PGLOADER.PARSER::LOAD-MSSQL-DATABASE
PGLOADER.PARSER::LOAD-SQLITE-DATABASE)
PGLOADER.PARSER::END-OF-COMMAND)
Subexpression PGLOADER.PARSER::END-OF-COMMAND
Subexpression (AND PGLOADER.PARSER::IGNORE-WHITESPACE #\;
PGLOADER.PARSER::IGNORE-WHITESPACE)
Subexpression ";"
;
; compilation unit aborted
; caught 1 fatal ERROR condition
Here is the PostgreSQL create table statement that it generates without the CAST. You can definitely see that the problem is the default value for column title.
ERROR: syntax error at or near "Title" at character 191
CREATE TABLE "Page"
(
projectid bigserial not null,
projectname text not null,
title text default 'N'Title'',
scheduletype int default '0',
);
Trying to transfer from MSSQL to PostgreSQL I can't make this work. I'm trying to drop the default value for a column because the default value is N'Title and it seems to mess up with the parser.
Error:
Here is the PostgreSQL create table statement that it generates without the CAST. You can definitely see that the problem is the default value for column title.