Skip to content

Binary string (BYTEA, Binary) concatenation #12709

@kawadakk

Description

@kawadakk

Is your feature request related to a problem or challenge?

Currently there doesn't seem to be a direct way to concatenate binary strings in SQL expressions.

  • lhs || rhs does not accept Binary arguments.
  • concat(lhs, rhs) coerces both sides to Utf8, which does not work if they are not valid UTF-8 strings.
  • array_concat(lhs, rhs) only works for List, not Binary.
  • decode(encode(lhs, 'hex') || encode(rhs, 'hex'), 'hex') works, but this is verbose and inefficient.

Describe the solution you'd like

The || operator could be extended to support Binary arguments, following the behavior of other SQL engines, such as SQLite and PostgreSQL.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions