scribase
SQLSTATE XX000internal_errorHTTP 500

Postgres error XX000: internal error

internal error

Postgres hit a condition it considers a bug or an unexpected state, such as a cache lookup failure or corrupted data.

Common causes

  • Concurrent DDL dropping an object while another session used it ("cache lookup failed").
  • Data corruption, or a bug in Postgres or an extension.

How to fix it

  • Retry once; transient catalog races resolve themselves.
  • If it repeats, note the exact message and query and check the server log; with corruption suspected, take a backup first and use amcheck before anything else.

Through a REST API

PostgREST, the REST layer behind supabase-js and Scribase, answers HTTP 500 for this error and returns the SQLSTATE in the code field of the JSON error body.

Questions

What does Postgres error XX000 mean?

XX000 is internal_error in class XX (Internal Error). Postgres hit a condition it considers a bug or an unexpected state, such as a cache lookup failure or corrupted data.

How do I fix XX000?

Retry once; transient catalog races resolve themselves. If it repeats, note the exact message and query and check the server log; with corruption suspected, take a backup first and use amcheck before anything else.

What HTTP status does a REST API return for XX000?

PostgREST, the REST layer behind supabase-js, answers 500.