When staging behaves differently from production, the cause is often a missing index or a column with another type. Comparing the definitions is quick when you dump them without data.
pg_dump -s -f prod-schema.sql -h db1.example.com appdb
pg_dump -s -f stage-schema.sql -h db2.example.com appdb
diff -u prod-schema.sql stage-schema.sql
-s (long form --schema-only) writes tables, indexes, constraints, views, functions and triggers, and no rows. Even for a big database the file is small and done in seconds. pg_dump writes objects in a stable order, so two dumps of identical schemas diff clean.
The name is confusing: -n, long form --schema, is a different option that picks a PostgreSQL schema such as public. The docs warn about mixing those two up.
A diff can still show noise. Different pg_dump versions write slightly different SQL, so use the same client version for both sides. Owners and grants differ between environments more often than I’d like; -O and -x leave out ownership and privileges when you only care about structure. Sequences show their definition, not their current value.
Further reading: pg_dump