Quantcast
Channel: User Frank Heikens - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 124

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

$
0
0

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 all articles
Browse latest Browse all 124

Trending Articles