Troubleshooting

When a statement does not run

Run tablebelt doctor first. Each check prints ok, warn, or fail, with a fix. It covers config, secrets present, upstream reachable, TLS on both sides, snapshot and restore privileges, transaction pooler detection, schema version, clock skew, and cloud reachability when the proxy is linked.

doctor
tablebelt doctor

Doctor warnings you will actually hit

Error codes

Drivers surface TB codes as a database error. The message tells the agent what happened and what to ask you. It also tells the agent not to rewrite the SQL to dodge the hold.

CodeWhenWhat to do
noticeHold createdNames the hold id and how long it will wait. Pro and Team add a dashboard link.
TB001Block timeout, still pendingNot executed. Ask a person to approve, then run the same statement again.
TB002DeniedNames who denied it and their note. Do not rewrite the statement to get around it.
TB003Unparsed, too large, or classifier errorThe statement did not run.
TB004Snapshot failed after approvalThe statement did not run. Retry, or approve with an explicit no-snapshot acknowledgement.
TB005Protected objectSchema tablebelt is not reachable through the proxy.
TB006Too many pending holdsDefault cap is 100. This statement did not run.
TB007Hold expiredRun it again if you still want a new hold.
TB008Policy denyA rule, COPY PROGRAM, FunctionCall, or PREPARE of a held statement.
TB009Replication or disallowed startup optionsThe connection is refused.
TB010Hold store unavailableStatements that would be held do not run. Allowed statements still pass.
57014Client cancelled while heldThe hold stays pending.
25P02Next statement after a rejected hold inside a transactionThe proxy matches Postgres: the transaction looks aborted until ROLLBACK.

A hold that seems stuck

  1. tablebelt held shows pending rows. tablebelt show hold_0007 shows the statement, tables, and snapshot plan.
  2. Approve with tablebelt approve hold_0007, or in the dashboard on Pro and Team.
  3. If the plan has no snapshot, pass --no-snapshot. A fresh install denies DROP DATABASE before you get that far.
  4. After approval, run the same statement again if the block timeout (TB001) already returned. One approval runs it once.
  5. Inside an open transaction, a rejected hold makes later statements look aborted (25P02) until ROLLBACK. That matches Postgres.

Exit codes for the CLI: 0 ok, 1 error, 2 usage, 3 not found, 4 refused (policy or a declined confirmation), 5 proxy not reachable.

More on limits: Rules. More on what is sent: Security.