I am trying to change the type of the data type (from VARCHAR to DATE in PostgreSQL).
Generally the below code works but as you can see there are two date types for cc_active_date. Is there a way to emulate try catch in such scenario so that if casting DD/MM/YYYY fails then it takes YYYY-MM-DD hh:mm:ss?
alter table credit_card.hsbc alter column cc_active_date type date
using to_date(cc_active_date, 'DD/MM/YYYY')
