Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Yandex MPP Analytics for PostgreSQL
  • Getting started
    • All guides
    • Connecting to an external file server (gpfdist)
    • Access from Trino
      • Managing extensions
      • gp_relaccess_stats
      • gp_relsizes_stats
      • gp_url_tools
      • pgcrypto
      • try_convert
      • uuid-cb
      • Yezzey
    • Auxiliary utilities
  • Access management
  • Inspections and recommendations
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  1. Step-by-step guides
  2. Extensions
  3. try_convert

Using try_convert in Yandex MPP Analytics for PostgreSQL

Written by
Yandex Cloud
Updated at September 14, 2026
View in Markdown

try_convert is a Yandex Cloud extension which works in the same way as the TRY_CONVERT function and converts data from one type to another. This extension enables type conversions when there are errors in the input data. Without try_convert, such conversions are performed in pl/pgsql, resulting in increased CPU consumption.

The extension only supports the standard Greenplum® data types. To use other data types, add them using the add_type_for_try_convert function.

Here is an example:

SELECT add_type_for_try_convert('hstore'::regtype);

For more information about this extension, see this try_convert guide.

To install the extension, contact support.

Use casesUse cases

  1. Convert text that is convertible to a number:

    SELECT TRY_CONVERT('42'::text, 0::int2);
    

    The returned result is 42.

  2. Convert text that is not convertible to a number:

    SELECT TRY_CONVERT('42d'::text, 1234::int2);
    

    The returned result is 1234.

Greenplum® and Greenplum Database® are registered trademarks or trademarks of Broadcom Inc. in the United States and/or other countries.

Was the article helpful?

Previous
pgcrypto
Next
uuid-cb
© 2026 Direct Cursus Technology L.L.C.