cockroachdb / cockroachdb/cockroach

Incomplete support for syntax for bit-string constants b'101'

Open
#108,279 3 comments 0 reactions 0 assignees View on GitHub
A-sql-pgcompat O-community T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The b'101' syntax is being read as bytes, but [should be](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-BIT-STRINGS) read as a bit-string for compatibility with PostgreSQL.

```
root=> SELECT B'101'::integer;
int8
------
5
(1 ligne)
root=> SELECT b'101'::integer;
ERROR: invalid cast: bytes -> int
```

Running CockroachDB CCL v23.1.7 (x86_64-pc-linux-gnu, built 2023/07/27 00:54:56, go1.19.10)

Jira issue: CRDB-30409

Epic CRDB-60814

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.