mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Fix float-to-string to accept integers, fix #249.
The problem in #249 is that SQLite is happy processing floats in an integer field, so pgloader needs to be instructing via the CAST mechanism to cast to float at migration time. But then the transformation function would choke on integers, because of its optimisation "declare" statement. Of course the integer representation expected by PostgreSQL is float-compatible, so just instruct the function that integers are welcome to the party.
This commit is contained in:
parent
1c7de22096
commit
5f85bf542a
@ -150,7 +150,7 @@
|
||||
(defun float-to-string (float)
|
||||
"Transform a Common Lisp float value into its string representation as
|
||||
accepted by PostgreSQL, that is 100.0 rather than 100.0d0."
|
||||
(declare (type (or null float string) float))
|
||||
(declare (type (or null fixnum float string) float))
|
||||
(when float
|
||||
(typecase float
|
||||
(double-float (let ((*read-default-float-format* 'double-float))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user