# F051-05: Explicit CAST between datetime types and character string types

query T
SELECT CAST ( '2016-03-26' AS DATE )
----
2016-03-26

query T
SELECT CAST ( '01:02:03' AS TIME )
----
01:02:03

query T
SELECT CAST ( '2016-03-26 01:02:03' AS TIMESTAMP WITHOUT TIME ZONE )
----
2016-03-26 01:02:03

query T
SELECT CAST ( CAST ( '2016-03-26' AS DATE ) AS VARCHAR )
----
2016-03-26

query T
SELECT CAST ( CAST ( '01:02:03' AS TIME ) AS VARCHAR )
----
01:02:03

query T
SELECT CAST ( CAST ( '2016-03-26 01:02:03' AS TIMESTAMP WITHOUT TIME ZONE ) AS VARCHAR )
----
2016-03-26 01:02:03

query T
SELECT CAST ( CAST ( '01:02:03' AS TIME ) AS TIME )
----
01:02:03

# pg style
# query I
# SELECT CAST ( CAST ( '01:02:03' AS TIME ) AS TIMESTAMP )

query T
SELECT CAST ( CAST ( '01:02:03' AS TIME ) AS VARCHAR )
----
01:02:03

query T
SELECT CAST ( CAST ( '2016-03-26 01:02:03' AS TIMESTAMP WITHOUT TIME ZONE ) AS DATE )
----
2016-03-26

query T
SELECT CAST ( CAST ( '2016-03-26 01:02:03' AS TIMESTAMP WITHOUT TIME ZONE ) AS TIME )
----
01:02:03

query T
SELECT CAST ( CAST ( '2016-03-26 01:02:03' AS TIMESTAMP WITHOUT TIME ZONE ) AS TIMESTAMP )
----
2016-03-26 01:02:03

query T
SELECT CAST ( CAST ( '2016-03-26 01:02:03' AS TIMESTAMP WITHOUT TIME ZONE ) AS VARCHAR )
----
2016-03-26 01:02:03
