Signature
bytea || bytea → byteaParameters
| Parameter | Type | Description |
|---|---|---|
| bytes1 | bytea | First binary string |
| bytes2 | bytea | Second binary string |
Examples
SELECT '\x123456'::bytea || '\x789a00bcde'::bytea;\x123456789a00bcdeSELECT '\x00'::bytea || '\xFF'::bytea;\x00ffSELECT '\xDEAD'::bytea || '\xBEEF'::bytea;\xdeadbeefSELECT header || payload || trailer FROM binary_frames;Assembled binary frameUse `||` to assemble binary protocol frames from component byte sequences in SQL. Combine with `decode('...', 'hex')` or `set_byte` for dynamic byte construction.
SELECT '\x01'::bytea || length(payload)::int2::bytea || payload FROM messages;Simple binary frame: type byte, 2-byte length, payload