Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extension TRY_CONVERT adds function TRY_CONVERT
TRY_CONVERT was made to use like TRY_CAST from SQL-Server
Due polymorphism have strange signature (some_type, anyelement) -> anyelement
First parament is SOURCE_VALUE
Second parameter is DEFAULT_VALUE::TARGET_TYPE
We cannot have (any1, any2) -> any2 signature with different anyelement types, but we can create multiple (_, any) -> any functions in
contrib/try_convert/try_convert--1.0.sql
or useselect add_type_for_try_convert('date'::regtype);
to add types.In init we can add all supported types, but with
add_type_for_try_convert
user can add whatever type he wantsERROR HANDLING
Error handles by PG_TRY() PG_CATCH()
But better way is use "soft" error handling from Postgres 17 (postgres/postgres@ccff2d2) it also realising OPENGPDB (open-gpdb/gpdb@21be368). Of course it needs to convert datatype function to support "soft" error handling
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheck
make -C src/test installcheck-cbdb-parallel
Impact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions