I have a postgres database with a table that has a column which is an array of postgres timestamps (TIMESTAMP[]). For reasons, I need to convert this column to be an integer array of unix timestamps (INTEGER[]). I have some data (existing timestamp arrays) in the column I would like to convert over when I change the data type, somehow.
I'm not too well versed in sql, have tried googling around for an answer, and the best I could piece together is this:
ALTER TABLE some_table
ALTER COLUMN phases_started_at TYPE integer[]
USING phases_started_at::integer[];
This gives me sql conversion errors though, saying something generic about not being able to convert a timestamp with no zone to an integer