Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Proposal: is_castable - Mailing list pgsql-hackers
From
Michał Wadas
Subject
Proposal: is_castable
Date
April 3, 2020
14:45:31
Msg-id
CAMEnU0Ae+h5zFoEra004NXTaPxPYABv4B9SdR9Tm15mNPT6OOQ@mail.gmail.com
Whole thread
Raw
Responses
Re: Proposal: is_castable
Re: Proposal: is_castable
List
pgsql-hackers
Tree view
Currently there is no way to check if CAST will succeed.
Therefore I propose adding new function: is_castable
SELECT is_castable('foo' as time) // false
SELECT is_castable('123' as numeric) // true
SELECT is_castable(1.5 as int) // true
SELECT is_castable('1.5' as int) // false
Many users write their own functions:
https://stackoverflow.com/q/10306830/2446102
(11k views, ~25 upvotes)
https://stackoverflow.com/q/36775814/2446102
https://stackoverflow.com/a/16206123/2446102
(72k views, 70 upvotes)
https://stackoverflow.com/q/2082686/2446102
(174k views, ~150 upvotes)
Similar features are implemented in:
- SQL Server (as TRY_CONVERT)
- Oracle (as CONVERT([val] DEFAULT [expr] ON CONVERSION ERROR)
I would love to implement it myself, but my knowledge of C is superficial.
Thanks,
Michał Wadas
pgsql-hackers
by date:
Previous
From:
Kashif Zeeshan
Date:
03 April 2020, 13:01:17
Subject:
Re: WIP/PoC for parallel backup
Next
From:
Pavel Stehule
Date:
03 April 2020, 15:05:55
Subject:
Re: Proposal: is_castable
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies