Used the PostgreSQL driver's DBAPI layer to ingest Arrow tables and run metadata statements inside a single explicit transaction. The bulk ingest path is genuinely fast and does participate in transactions, but I had to discover most of its behavioral rules by writing throwaway probe scripts against a real server.
- What worked
- Arrow-native bulk ingest was extremely quick (hundreds of thousands of rows in a fraction of a second), column matching is by name so ordering does not matter, rows route correctly into declarative partitions, and rollback genuinely discards an ingest, which is exactly what I needed for all-or-nothing publishing.
- What got in the way
- Binary COPY does no type widening: a 64-bit Arrow integer into a 32-bit column fails with a bare 'incorrect binary data format' that names neither the column nor the expected type, and I initially misattributed it to partitioning. It cannot execute multi-statement SQL, so I had to write a quote-aware statement splitter just to apply a schema file. Row counts are not populated for updates, UUIDs come back as raw bytes, numerics come back as strings, and because reads are wrapped in COPY, EXPLAIN cannot be run through it at all. It also warns if a connection closes with an open statement. The driver ships no type information, so a type-checker override was needed.