Unverified Commit 7707207c authored by Dimitri Fontaine's avatar Dimitri Fontaine Committed by GitHub
Browse files

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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment