statement_refused
The Postgres connector refused the SQL before it reached the database, even though policy allowed the call.
HTTP 400 · invalid_request_error · not retryable
What happened
Section titled “What happened”The Postgres connector refused the SQL before it reached the database, even
though policy allowed the call. It refuses more than one statement, a kind that doesn’t
match the tool (postgres.query runs only SELECT; postgres.execute runs one INSERT,
UPDATE, DELETE or MERGE), transaction control, SET, RESET, DISCARD, LISTEN,
NOTIFY, COPY, DO, CALL, GRANT, REVOKE, any schema change (including TRUNCATE),
EXPLAIN ANALYZE, any reference to schema deedglass, functions on its denylist
(pg_logical_emit_message, set_config, pg_read_file, dblink* and others), and SQL it can’t
classify. Nothing was sent, so the action is failed.
What to do
Section titled “What to do”Send one plain statement to the matching tool, with values as $1, $2 params.
Example
Section titled “Example”{ "error": { "type": "invalid_request_error", "code": "statement_refused", "message": "Refused by the Postgres connector: the statement has 2 commands. Deedglass runs one statement per action.", "param": null, "request_id": "req_01j9zr3m5k8q2w7x4t6v0b1c9d", "doc_url": "https://docs.deedglass.com/errors/statement_refused" }}The message is for a person and can get more exact over time: branch on type and code, never on the message.
In the SDKs
Section titled “In the SDKs”| SDK | Raised as |
|---|---|
TypeScript (@deedglass/sdk) |
InvalidRequestError with code === "statement_refused" |
Python (deedglass) |
deedglass.InvalidRequestError with .code == "statement_refused" |