Re: recasting to timestamp from varchar

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: recasting to timestamp from varchar
Дата
Msg-id 50E7BFE4.7070803@hogranch.com
обсуждение исходный текст
Ответ на recasting to timestamp from varchar  (Kirk Wythers <wythe001@umn.edu>)
Список pgsql-general
On 1/4/2013 9:28 AM, Kirk Wythers wrote:
> ALTER TABLE sixty_min ALTER COLUMN time2 TYPE timestamp;
> ERROR:  column "time2" cannot be cast to type timestamp without time zone

you need to give it some hints as to how to do that casting.

ALTER TABLE sixty_min ALTER COLUMN time2 TYPE timestamp USING
to_timestamp(time2, 'YYYY-MM-DD HH24-MI-SS');


I would use timezone with time zone as the type here. Effectively, this
type converts all input times to UTC from either the specified or
client's default TZ, and converts all time output to either the
specified or client's TZ.    it behaves properly, while 'timestamp'
without timezone doesn't..




В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: PostgreSQL run as process in windows
Следующее
От: ERR ORR
Дата:
Сообщение: Question on Trigram GIST indexes