Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mssql drop default or change default of timestampz columns #1343

Closed
2 tasks done
bradydean opened this issue Dec 7, 2021 · 3 comments · May be fixed by #1466
Closed
2 tasks done

mssql drop default or change default of timestampz columns #1343

bradydean opened this issue Dec 7, 2021 · 3 comments · May be fixed by #1466

Comments

@bradydean
Copy link

  • pgloader --version

    pgloader version "3.6.3~devel"
    
  • did you search for other similar issues?

I have a mssql db using timestampz with a default of getdate() which I think translates to getutctime(). The default casting rules preserves this default but it is not compatible with postgres. I can't find any way to override the casting rules like what is possible with mysql.

I'm using this command file

load database
     from mssql://SA:{{SA_PASSWORD}}@mssql-db/mobilerecellcom
     into postgresql://postgres:postgres@db/postgres
     cast type timestamptz to timestamptz drop default

before load do $$ CREATE EXTENSION IF NOT EXISTS "uuid-ossp" $$

including only table names like 'MR_Requests', 'MR_Organization' in schema 'dbo'

alter schema 'dbo' rename to 'public'

;

which produces this output

2021-12-07T15:27:50.265000Z ERROR Database error 22007: invalid input syntax for type timestamp with time zone: "getutcdate()"

It doesn't seem like the cast rule has any affect here.

@badeball
Copy link

badeball commented Nov 1, 2022

Did you ever figure this one out?

@bradydean
Copy link
Author

Unfortunently not. We ended up writing migration scripts by hand to move data between our dbs. The schemas and data translations were just too different for pgloader to deal with.

@badeball
Copy link

badeball commented Nov 1, 2022

Alright, I see. That's what I was fearing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants