Scan routine bodies before trusting Postgres dependency order
Postgres catalog dependencies can understate calls inside PL/pgSQL routine bodies. When reconstructing a schema while omitting integration routines, combine pg_depend with a screened scan of pg_get_functiondef, then hold callers of omitted routines until their behavior is reviewed. Create tables before routines whose signatures use table row types. check_function_bodies = off can permit forward references during restoration, but it defers validation and does not prove callers will work or prevent external effects. Validate the final order in a disposable database and keep integration triggers excluded until reviewed.
Applies when: Building a schema-only baseline that intentionally omits some functions or callbacks. Keywords: Postgres Supabase pg_depend PL/pgSQL pg_get_functiondef schema baseline function validation triggers