Drop default value on bigserial CAST in MS SQL.

This is a blind attempt to fix #354.
This commit is contained in:
Dimitri Fontaine 2016-03-09 18:30:18 +01:00
parent 57f7fd1d4e
commit b7a873c03f

View File

@ -109,7 +109,11 @@
(declare (ignore schema)) ; FIXME
(let* ((ctype (mssql-column-ctype field))
(pgcol
(apply-casting-rules table-name name type ctype default nullable nil)))
(apply-casting-rules table-name name type ctype
;; drop default value (forcing it to nil
;; here) for serial data types
(unless (string= "bigserial" ctype) default)
nullable nil)))
;; the MS SQL driver smartly maps data to the proper CL type, but the
;; pgloader API only wants to see text representations to send down the
;; COPY protocol.