SQLSTATE 26000invalid_sql_statement_nameHTTP 400
Postgres error 26000: invalid sql statement name
prepared statement "x" does not exist
The driver tried to execute a named prepared statement that this server connection never saw.
Common causes
- Transaction-mode pooling: the statement was prepared on one server connection and executed on another.
- DISCARD ALL or a reconnect cleared prepared statements the driver still remembers.
How to fix it
- Disable named prepared statements in the driver behind a transaction pooler.
- Use session-mode or direct connections for that client.
Through a REST API
PostgREST, the REST layer behind supabase-js and Scribase, answers HTTP 400 for this error and returns the SQLSTATE in the code field of the JSON error body.
Questions
What does Postgres error 26000 mean?
26000 is invalid_sql_statement_name in class 26 (Invalid SQL Statement Name). The driver tried to execute a named prepared statement that this server connection never saw.
How do I fix 26000?
Disable named prepared statements in the driver behind a transaction pooler. Use session-mode or direct connections for that client.
What HTTP status does a REST API return for 26000?
PostgREST, the REST layer behind supabase-js, answers 400.