Quantcast
Viewing latest article 26
Browse Latest Browse All 118

Answer by Frank Heikens for PostgreSQL alternative to SQL Server’s `try_cast` function

It's a fairly old question but the answer is now sort of obsolete. Since PostgreSQL version 16 you can use the function pg_input_is_valid() to see if your input is valid for your data type:

SELECT pg_input_is_valid('0', 'integer'); -- returns TRUE

Viewing latest article 26
Browse Latest Browse All 118

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>