Closed seamusabshere closed 5 years ago
Yeah it's fair to say that pgloader should be able to handle that case automatically. I've implemented the above in the referenced patch. Please compile from fresh sources and try again, and open this issue again is something is still off.
@dimitri best bug response ever
[x] did you test a fresh compile from the source tree?
[x] did you search for other similar issues?
[x] how can I reproduce the bug?
[skipping some of the steps below because this is a simple "bug"]
basically i have a table like this:
and a csv like this
Notice they have the same column names but different order, and the table has an extra column.
What I expect:
csv header
is smart enough to know to importa
->a
,b
->b
, and not try to import anything into_c
. But it tries to importa
->_c
(I know because it saysDatabase error 22P02: invalid input syntax for integer
etc.)I know that I can specify a different ordering by providing
HAVING FIELDS
andTARGET COLUMNS
, but shouldn't it be able to do that automatically?