ossc-db / pg_bulkload

High speed data loading utility for PostgreSQL
http://ossc-db.github.io/pg_bulkload/index.html
Other
433 stars 75 forks source link

Bad table attributes count when parsing #161

Open Fabiencdp opened 7 months ago

Fabiencdp commented 7 months ago

Got an error after adding then removing a column multiple times in the destination table:

    NOTICE: BULK LOAD START
    ,ERROR: copy failed: ERROR:  function return row and target table row do not match
    DETAIL:  Returned row contains 24 attribute(s), but target table expects 27.

The table as 24 attributes. Seems that the value "27" come from the "ordinal_position" of "information_schema.columns" wich look like a autoincrement value. so adding/deleting columns could break the count of attributes.

select ordinal_position 
from information_schema.columns
where table_name = 'table_name' and column_name = 'column_name';