From b7a873c03f98b2bae2802e1f89130df2bcbddcb0 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 9 Mar 2016 18:30:18 +0100 Subject: [PATCH] Drop default value on bigserial CAST in MS SQL. This is a blind attempt to fix #354. --- src/sources/mssql/mssql-cast-rules.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sources/mssql/mssql-cast-rules.lisp b/src/sources/mssql/mssql-cast-rules.lisp index 0ea8306..5a3a07b 100644 --- a/src/sources/mssql/mssql-cast-rules.lisp +++ b/src/sources/mssql/mssql-cast-rules.lisp @@ -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.