From 2b6fb3e6c2b88060f326af86582ed1deade303c5 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 8 May 2019 23:36:17 +0200 Subject: [PATCH] Add a casting rule for the I data type in DBF files. The I data type is mapped to a PostgreSQL integer. See #929. --- docs/ref/dbf.rst | 3 ++- src/sources/db3/db3-cast-rules.lisp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/ref/dbf.rst b/docs/ref/dbf.rst index 4e6ffc1..e6af1d5 100644 --- a/docs/ref/dbf.rst +++ b/docs/ref/dbf.rst @@ -65,7 +65,8 @@ When migrating from DB3 the following Casting Rules are provided:: type C to text using db3-trim-string type M to text using db3-trim-string - type N to numeric using db3-numeric-to-pgsql-numeric + type N to numeric using db3-numeric-to-pgsql-integer + type I to numeric using db3-numeric-to-pgsql-numeric type L to boolean using logical-to-boolean type D to date using db3-date-to-pgsql-date diff --git a/src/sources/db3/db3-cast-rules.lisp b/src/sources/db3/db3-cast-rules.lisp index 908c670..a711d68 100644 --- a/src/sources/db3/db3-cast-rules.lisp +++ b/src/sources/db3/db3-cast-rules.lisp @@ -16,6 +16,10 @@ :target (:type "numeric") :using pgloader.transforms::db3-numeric-to-pgsql-numeric) + (:source (:type "I") + :target (:type "integer") + :using pgloader.transforms::db3-numeric-to-pgsql-integer) + (:source (:type "L") :target (:type "boolean") :using pgloader.transforms::logical-to-boolean)