Postgres error: 'could not access status of transaction' when PostgREST runs LISTEN
The error
You’ll see this in your database logs:
- Error:
could not access status of transaction - Detail:
Could not open file "pg_xact/[ID]": No such file or directory - Application: PostgREST (shown as
PostgREST 13.0.5or similar) - Command:
LISTEN
If you see the first error message without the pg_xact detail, or outside PostgREST, it may be a different issue.
What’s happening
This is an upstream Postgres bug but affects PostgREST. The notification queue gets stuck and tries to access old transaction IDs that no longer exist.
Fix
Run this command in the SQL editor:
SELECT pg_notification_queue_usage();This clears the stuck queue. Your Data API will become responsive again, and the errors should stop.
If it happens again
Run the command above again.
If you upgrade to PostgREST v14.8+, the logs will include a HINT that tells you to run SELECT pg_notification_queue_usage();. You can upgrade PostgREST and Postgres in Infrastructure Settings.