Open ejoubaud opened 1 year ago
I found a way to make it work, for pg at least:
sq:file.sqlite=> \copy pg://course@localhost?sslmode=disable sqlite://file.sqlite 'SELECT EXTRACT(EPOCH FROM NULL::timestamp) AS value' input
COPY 1
sq:file.sqlite=> \copy pg://course@localhost?sslmode=disable sqlite://file.sqlite 'SELECT NULL::numeric AS value' input
COPY 1
sq:file.sqlite=> select value, value is null from input;
value | value is null
-------+---------------
| 1
| 1
(2 rows)
If anyone has the same issue you can cast your NULL to ::numeric
in the source pg query, rather than ::integer
or ::bool
. That works for a Postgres source, not sure if it's a problem with other source DBMS.
Could you also try with the pgx
driver? It might handle untyped nulls differently.
Hi there,
First thanks for this great tool, it's super helpful to manipulate data from different source DB engines 🙇
That said it looks like the
\copy
from NULL values doesn't work great, at least from pg to sqlite:Looks like the trip into Go land doesn't account very well for the possibility of NULL values.