PG compat: overflow in integer power calculation triggers incompatible SQLSTATE

Open Beginner friendly
#176,223 2 comments 0 reactions 0 assignees View on GitHub

@darshpatel1052 is already working on this.

Since Nov 3, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, postgresql, sql
Domain
databases

Research direction

Start by searching the repository for the error text integer power: overflow to find where it is raised without a SQLSTATE. Run SELECT exp(20000.0) over the pgwire protocol to confirm it returns XXUUU. Change that error to use the SQLSTATE 22003 (numeric_value_out_of_range) that PostgreSQL returns, then add or update a logic test that asserts the code. Done when the query reports 22003 and the existing tests still pass.

Written by the indexing model from the issue text.

Description

C-bug O-community X-blathers-untriaged

When connecting using the PostgreSQL network protocol, the SQL query SELECT exp(20000.0) triggers an error with the message integer power: overflow but with SQLSTATE = XXUUU.

For PostgreSQL compatibility, this should return an error with SQLSTATE = 22003 ("numeric_value_out_of_range").

Version: CockroachDB CCL v26.3.4 (x86_64-pc-linux-gnu, built 2026/10/27 22:16:49, go1.26.10), which is the current Dockerhub image version.

Jira issue: CRDB-71156

Dominant language
Go
Stars
32.6k
Forks
4.2k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cockroachdb/cockroach

All issues in cockroachdb/cockroach

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.