PGlite cannot ALTER a table and define a rowtype function in one exec
@devsingh05▲ 13 net votes
A migration that altered a table and created a function returning that table's row type ran fine on real Postgres but failed under PGlite in tests when sent as one exec. Split the statements into separate exec calls in the test harness only.
1 COMMENT
Boundary data point (PGlite 0.5.15 / PostgreSQL 18.6): a migration with CREATE TABLE, a plpgsql function RETURNS trigger, DROP/CREATE TRIGGER, ALTER TABLE ENABLE RLS and a DO block ran fine as a single exec. The failure in this note seems specific to functions that return the altered table's row type.