mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-10 00:07:00 +02:00
Cast MySQL bigint(20) into numeric, fix #253.
In MySQL it's possible to have a bigint of 20 digits when using the "unsigned" variant of the data type, whereas in PostgreSQL there's no such variant and bigints are "limited" to the range -9223372036854775808 to +9223372036854775807 (19 digits numbers). Fix the default casting rule to switch to PostgreSQL numeric in such cases.
This commit is contained in:
parent
a308dd9bda
commit
c3986b0997
@ -69,6 +69,11 @@
|
|||||||
:target (:type "boolean" :drop-typemod t)
|
:target (:type "boolean" :drop-typemod t)
|
||||||
:using pgloader.transforms::bits-to-boolean)
|
:using pgloader.transforms::bits-to-boolean)
|
||||||
|
|
||||||
|
;; bigint(20) unsigned (or not, actually) does not fit into PostgreSQL
|
||||||
|
;; bigint (-9223372036854775808 to +9223372036854775807):
|
||||||
|
(:source (:type "bigint" :typemod (< 19 precision))
|
||||||
|
:target (:type "numeric" :drop-typemod t))
|
||||||
|
|
||||||
;; we need the following to benefit from :drop-typemod
|
;; we need the following to benefit from :drop-typemod
|
||||||
(:source (:type "tinyint") :target (:type "smallint" :drop-typemod t))
|
(:source (:type "tinyint") :target (:type "smallint" :drop-typemod t))
|
||||||
(:source (:type "smallint") :target (:type "smallint" :drop-typemod t))
|
(:source (:type "smallint") :target (:type "smallint" :drop-typemod t))
|
||||||
|
Loading…
Reference in New Issue
Block a user