mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
handling mssql datetimeoffset (#1113)
This commit is contained in:
parent
b3cd5f28d6
commit
c2b9f79413
@ -99,7 +99,8 @@
|
||||
:syb-datetime4
|
||||
:syb-msdate
|
||||
:syb-mstime
|
||||
:syb-msdatetime2)
|
||||
:syb-msdatetime2
|
||||
:syb-msdatetimeoffset)
|
||||
(with-foreign-pointer (%buf +numeric-buf-sz+)
|
||||
(let ((count
|
||||
(%dbconvert %dbproc
|
||||
|
||||
@ -64,7 +64,8 @@
|
||||
|
||||
(:source (:type "smalldatetime") :target (:type "timestamptz"))
|
||||
(:source (:type "datetime") :target (:type "timestamptz"))
|
||||
(:source (:type "datetime2") :target (:type "timestamptz")))
|
||||
(:source (:type "datetime2") :target (:type "timestamptz"))
|
||||
(:source (:type "datetimeoffset") :target (:type "timestamptz")))
|
||||
"Data Type Casting to migrate from MSSQL to PostgreSQL")
|
||||
|
||||
;;;
|
||||
|
||||
@ -168,11 +168,12 @@
|
||||
|
||||
Mostly we just use the name, and make try to avoid parsing dates."
|
||||
(case (intern (string-upcase type) "KEYWORD")
|
||||
(:time (format nil "convert(varchar, [~a], 114)" name))
|
||||
(:datetime (format nil "convert(varchar, [~a], 126)" name))
|
||||
(:datetime2 (format nil "convert(varchar, [~a], 126)" name))
|
||||
(:smalldatetime (format nil "convert(varchar, [~a], 126)" name))
|
||||
(:date (format nil "convert(varchar, [~a], 126)" name))
|
||||
(:time (format nil "convert(varchar(30), [~a], 114)" name))
|
||||
(:datetime (format nil "convert(varchar(30), [~a], 126)" name))
|
||||
(:datetime2 (format nil "convert(varchar(30), [~a], 126)" name))
|
||||
(:datetimeoffset (format nil "convert(varchar(35), [~a], 127)" name))
|
||||
(:smalldatetime (format nil "convert(varchar(30), [~a], 126)" name))
|
||||
(:date (format nil "convert(varchar(30), [~a], 126)" name))
|
||||
(:bigint (format nil "cast([~a] as numeric)" name))
|
||||
(t (format nil "[~a]" name))))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user