Skip to content

Commit b2f9590

Browse files
committed
Add support for MS SQL XML data type.
Given a test case and some reading of the FreeTDS source code, it appears that the XML data type is sent on the wire as (unicode) text. This patch makes pgloader aware of that and also revisit the choice of casting XML to PostgreSQL XML data type (thanks to the test case where we see it just works without surprise). Fix #503.
1 parent 296e571 commit b2f9590

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/monkey/mssql.lisp

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
(let ((syb-type (foreign-enum-keyword '%syb-value-type type)))
8282
(case syb-type
8383
;; we accept emtpy string (len is 0)
84-
((:syb-char :syb-varchar :syb-text)
84+
((:syb-char :syb-varchar :syb-text :syb-msxml)
8585
(foreign-string-to-lisp data :count len))
8686

8787
(otherwise

src/sources/mssql/mssql-cast-rules.lisp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(:source (:type "varchar") :target (:type "text" :drop-typemod t))
1111
(:source (:type "nvarchar") :target (:type "text" :drop-typemod t))
1212
(:source (:type "ntext") :target (:type "text" :drop-typemod t))
13-
(:source (:type "xml") :target (:type "text" :drop-typemod t))
13+
(:source (:type "xml") :target (:type "xml" :drop-typemod t))
1414

1515
(:source (:type "int" :auto-increment t)
1616
:target (:type "bigserial" :drop-default t))

0 commit comments

Comments
 (0)