select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / BINARY STRING FUNCTIONS AND OPERATORS

Converts a binary string representing text in encoding src_encoding to a binary string in encoding dest_encoding (see Section 23.3.4 for available conversions).

Signatures & examples

convert ( bytes bytea, src_encoding name, dest_encoding name ) → bytea
Converts a binary string representing text in encoding src_encoding to a binary string in encoding dest_encoding (see Section 23.3.4 for available conversions).
convert('text_in_utf8', 'UTF8', 'LATIN1') → \x746578745f696e5f75746638
Version history 6
  1. PG 16 → 17changed
  2. PG 13 → 14changed
  3. PG 12 → 13changed
  4. PG 11 → 12changed
  5. PG 9.6 → 10changed
  6. PG 9.5 → 9.6changed

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source