On Mon, Aug 14, 2006 at 08:00:59AM -0400, Mike Ellsworth wrote:
> Is there a way to convert data type `datetime` into an integer
There is no datetime type. Do you mean timestamp or timestamp with
time zone?
> (unix_timestamp) while doing ALTER COLUMN `column_name` TYPE int4
> USING CAST(`column_name` as integer) ...... something like this?
Is this what you're looking for?
ALTER TABLE foo ALTER COLUMN column_name TYPE integer
USING extract(epoch FROM column_name);
--
Michael Fuhr