3 ways. Provided functions, CAST
, or ::
.
Provided functions:
-
to_char
— can convert timestamp, interval, integer to char -
to_date
— can convert string into date -
to_number
— can convert string into number -
to_timestamp
— can convert string into timestamp
SELECT CAST(varchar 'juanito' AS TEXT);
SELECT COALESCE((id)::bigint, id_bigint) AS id
FROM webhooks