Re: recasting to timestamp from varchar

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: recasting to timestamp from varchar
Date: 2013-01-05 05:19:53
Message-ID: CAPTjJmrtWYEyEkA34nkAy+PtXvMm539UP1q+QwJNnKH_=NXTsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jan 5, 2013 at 4:28 AM, Kirk Wythers <wythe001(at)umn(dot)edu> wrote:
>
> I am trying to re-cast a column as a timestamp>
>
> ALTER TABLE sixty_min ALTER COLUMN time2 TYPE timestamp;
> ERROR: column "time2" cannot be cast to type timestamp without time zone
>
> The column time2 is currently a varchar. I actually do not want to mess with time zones, but it seems that postgres will not let me do this.

What exactly do you mean about your time zones? Are all your times in
UTC? If they're all in "local time", then you'll want to record time
zones, if only to prevent confusion around DST. It's really much MUCH
safer to incorporate tz.

ChrisA

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-01-05 05:24:41 Re: PostgreSQL run as process in windows
Previous Message Tatsuo Ishii 2013-01-05 02:04:18 Re: pgpool2 load balancing not working