Re: Alter column - Mailing list pgsql-novice

From Christoph Frick
Subject Re: Alter column
Date
Msg-id 20060814120633.GY29262@byleth.sc-networks.de
Whole thread Raw
In response to Alter column  (Mike Ellsworth <nhrcommu@rochester.rr.com>)
List pgsql-novice
On Mon, Aug 14, 2006 at 08:00:59AM -0400, Mike Ellsworth wrote:

hi,

> Is there a way to convert data type `datetime` into an integer
> (unix_timestamp) while doing ALTER COLUMN `column_name` TYPE int4
> USING CAST(`column_name` as integer) ...... something like this?

i dont know, if it solves your problem - for reading i usually cast like
this:

 EXTRACT(EPOCH FROM ts) as ts

and for writing:

 ts::int4::abstime::timestamp

--
cu

Attachment

pgsql-novice by date:

Previous
From: Mike Ellsworth
Date:
Subject: Alter column
Next
From: Michael Fuhr
Date:
Subject: Re: Alter column