Review table attributes listing and usage of attnum. (#690)
Given ALTER TABLE ... DROP COLUMN ... we could well have a table without an attribute with attnum == 1. Our code used to rely on that to happen in order to allocate our SourceTableAttribute array in-memory, before filling it in. Instead, use a window-function in the SQL query that we run against our internal SQLite catalogs, using count(*) over(order by attnum) to map whatever the Postgres attnum are into a proper gapless series that starts at one.
parent
cb55ea14
Please register or sign in to comment