pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

ESRAP-PARSE-ERROR from mssql -> psql

Open xxmxxxxxxx opened this issue 9 months ago • 0 comments

Hello, this is what I have in my pgloader file:

load database from mssql://***** into pgsql://*****

with include drop, truncate, create tables, create indexes, reset sequences, foreign keys

set work_mem to '16MB', maintenance_work_mem to '512MB'

CAST type bigint to bigint drop default, type uuid to uuid using (gen_random_uuid())

ALTER SCHEMA 'dbo' RENAME TO 'public' ALTER SCHEMA 'oauth2' RENAME TO 'oauth2'

before load do $$ drop schema if exists public cascade; $$;

And when I ran it, I got parsing error below:

2025-04-10T15:10:35.011000-04:00 LOG pgloader version "3.6.10~devel" KABOOM! ESRAP-PARSE-ERROR: At

CAST type bigint to bigint drop default, type uuid to uuid using (gen_random_uuid())

                                            ^ (Line 10, Column 46, Position 387)

In context SEXP-LIST:

While parsing SEXP-LIST. Problem:

The production

#\)

does not satisfy the predicate PGLOADER.PARSER::SYMBOL-FIRST-CHARACTER-P.

Expected:

 the character Tab

or the character Newline or the character Return or the character Space or the character " (QUOTATION_MARK) or the character # (NUMBER_SIGN) or the character ( (LEFT_PARENTHESIS) or the string "--" or the string "/*" or the character 0 (DIGIT_ZERO) or the character 1 (DIGIT_ONE) or the character 2 (DIGIT_TWO) or the character 3 (DIGIT_THREE) or the character 4 (DIGIT_FOUR) or the character 5 (DIGIT_FIVE) or the character 6 (DIGIT_SIX) or the character 7 (DIGIT_SEVEN) or the character 8 (DIGIT_EIGHT) or the character 9 (DIGIT_NINE) or any character satisfying SYMBOL-FIRST-CHARACTER-P An unhandled error condition has been signalled: At

CAST type bigint to bigint drop default, type uuid to uuid using (gen_random_uuid())

                                            ^ (Line 10, Column 46, Position 387)

In context SEXP-LIST:

While parsing SEXP-LIST. Problem:

The production

#\)

does not satisfy the predicate PGLOADER.PARSER::SYMBOL-FIRST-CHARACTER-P.

Expected:

 the character Tab

or the character Newline or the character Return or the character Space or the character " (QUOTATION_MARK) or the character # (NUMBER_SIGN) or the character ( (LEFT_PARENTHESIS) or the string "--" or the string "/*" or the character 0 (DIGIT_ZERO) or the character 1 (DIGIT_ONE) or the character 2 (DIGIT_TWO) or the character 3 (DIGIT_THREE) or the character 4 (DIGIT_FOUR) or the character 5 (DIGIT_FIVE) or the character 6 (DIGIT_SIX) or the character 7 (DIGIT_SEVEN) or the character 8 (DIGIT_EIGHT) or the character 9 (DIGIT_NINE) or any character satisfying SYMBOL-FIRST-CHARACTER-P

What I am doing here?

At

CAST type bigint to bigint drop default, type uuid to uuid using (gen_random_uuid())

                                            ^ (Line 10, Column 46, Position 387)

And this is the original column from mssql (my source DB) id uuid not null default uuid_generate_v4() I have extension "uuid-ossp" and both functions uuid_generate_v4(), gen_random_uuid() available in my target psql DB as well...

Do you have any idea how can I fix it please? Thank you!

xxmxxxxxxx avatar Apr 11 '25 14:04 xxmxxxxxxx