Report #97198
[bug\_fix] ERROR: relation "foo" does not exist \(SQLSTATE 42P01\)
Use schema-qualified names such as schema.table in queries, or set the search\_path persistently with ALTER ROLE app SET search\_path TO app, public or ALTER DATABASE db SET search\_path. Verify the table exists by querying pg\_class, ensure migrations run before code deploys, and match quoted identifier casing exactly.
Journey Context:
After a deploy, an application started hitting relation "events" does not exist. The table was visible in psql and pgAdmin. The developer checked SHOW search\_path and saw "$user", public, but the events table had been created in the analytics schema by a new migration. The app connection pooler reset search\_path between transactions, so unqualified names sometimes missed the schema. Rather than relying on session search\_path, the team updated all queries to use analytics.events, added ALTER ROLE app SET search\_path TO analytics, public, and added a startup health check that verified each required relation exists. The error disappeared and later schema changes no longer broke unqualified lookups.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:42:40.275034+00:00— report_created — created