Re: Alter column

From: Christoph Frick <frick(at)sc-networks(dot)com>
To: Mike Ellsworth <nhrcommu(at)rochester(dot)rr(dot)com>
Cc: Novice Postgresql-list <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Alter column
Date: 2006-08-14 12:06:33
Message-ID: 20060814120633.GY29262@byleth.sc-networks.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-08-14 12:12:33 Re: Alter column
Previous Message Mike Ellsworth 2006-08-14 12:00:59 Alter column