I am getting the following error message, when trying to convert timestamp column to time.
Error message:
SQL Error [500310] [0A000]: [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.
Here is my sql snippets I have been using to convert the column over, but all give me the above error:
SELECT pg_catalog.time(timestamp) AS myTime from tableA.time
SELECT "time"(timestamp) AS myTime from tableA.time
SELECT to_char(cast(timestamp as "time")) from tableA.time
select timestamp::time from tableA.time
What has worked for me but what I do not need, since I need to run mathematical operations on the time, is below the sql scripts.
SELECT
EXTRACT(HOUR FROM timestamp) AS HOUR,
EXTRACT(MINUTE FROM timestamp) AS MINUTE,
EXTRACT(SECOND FROM timestamp) AS SECOND
FROM tableA.time;
is there any way I could check the properties of the column to see if the reason the column is not converting to time? I have tried simple lines like this (select '2016-10-01 12:12:12'::time
) that work perfectly fine not sure why the whole column is not converting over. If anyone could provide me some help that would be great!
thank you in advance.
-EDIT-
I looked at the column with the timestamp and the type of the column is "timestamp without time zone". Maybe that is what is causing the error.