↑↓ 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 text string (in the database encoding) to a binary string encoded in encoding dest_encoding (see Section 23.3.4 for available conversions).

Reading PG 18current·documented in 20 of 27 versions, 8.3 to 20

Signatures & examples

convert_to ( string text, dest_encoding name ) → bytea
Converts a text string (in the database encoding) to a binary string encoded in encoding dest_encoding (see Section 23.3.4 for available conversions).
convert_to('some_text', 'UTF8') → \x736f6d655f74657874
Version history 4
  1. 16 → 17 changed
  2. 13 → 14 changed
  3. 12 → 13 changed
  4. 8.2 → 8.3 added

Definition snapshot: b7bd9cda · English manual source