mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-08 23:37:00 +02:00
Add support for MS SQL smalldatatime data type.
Availability of a test case for MS SQL allows to make progress on this limitation and add support to the smalldatetime data type. It is converted server-side with the same CONVERT expression as the longer datetime datatype. Fixes #431.
This commit is contained in:
parent
a799cd5f5f
commit
6bd17f45da
@ -94,7 +94,7 @@
|
||||
(:syb-int4 (unsigned-to-signed (mem-ref data :unsigned-int) 4))
|
||||
(:syb-int8 (mem-ref data :int8))
|
||||
(:syb-flt8 (mem-ref data :double))
|
||||
(:syb-datetime
|
||||
((:syb-datetime :syb-datetime4)
|
||||
(with-foreign-pointer (%buf +numeric-buf-sz+)
|
||||
(let ((count
|
||||
(%dbconvert %dbproc
|
||||
|
@ -59,6 +59,7 @@
|
||||
(:source (:type "varbinary") :target (:type "bytea")
|
||||
:using pgloader.transforms::byte-vector-to-bytea)
|
||||
|
||||
(:source (:type "smalldatetime") :target (:type "timestamptz"))
|
||||
(:source (:type "datetime") :target (:type "timestamptz"))
|
||||
(:source (:type "datetime2") :target (:type "timestamptz")))
|
||||
"Data Type Casting to migrate from MSSQL to PostgreSQL")
|
||||
|
@ -283,6 +283,7 @@ ORDER BY KCU1.CONSTRAINT_NAME, KCU1.ORDINAL_POSITION"
|
||||
Mostly we just use the name, and make try to avoid parsing dates."
|
||||
(case (intern (string-upcase type) "KEYWORD")
|
||||
(:datetime (format nil "convert(varchar, [~a], 126)" name))
|
||||
(:smalldatetime (format nil "convert(varchar, [~a], 126)" name))
|
||||
(:bigint (format nil "cast([~a] as numeric)" name))
|
||||
(t (format nil "[~a]" name))))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user