mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Handle MS SQL columns of float types without scale, fix #177.
The default for MS SQL float types is to only have a precision defined, as described in https://msdn.microsoft.com/en-us/library/ms173773.aspx, but the pgloader code didn't know what to do with a float without scale.
This commit is contained in:
parent
c5f0aeec93
commit
7fd1ddaa5f
@ -84,9 +84,21 @@
|
||||
(mssql-column-identity col))
|
||||
"bigserial")
|
||||
|
||||
((member type
|
||||
'("decimal" "numeric" "float" "double" "real")
|
||||
:test #'string=)
|
||||
((member type '("float" "real") :test #'string=)
|
||||
;; see https://msdn.microsoft.com/en-us/library/ms173773.aspx
|
||||
(if (mssql-column-numeric-scale col)
|
||||
(if (<= (mssql-column-numeric-scale col) 24)
|
||||
"float"
|
||||
"double precision")
|
||||
|
||||
;; no scale
|
||||
(format nil "~a(~a,~a)"
|
||||
type
|
||||
(mssql-column-numeric-precision col)
|
||||
(mssql-column-numeric-scale col))))
|
||||
|
||||
((member type '("decimal" "numeric" ) :test #'string=)
|
||||
;; https://msdn.microsoft.com/en-us/library/ms187746.aspx
|
||||
(format nil "~a(~a,~a)"
|
||||
type
|
||||
(mssql-column-numeric-precision col)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user