more on timestamps

Поиск
Список
Период
Сортировка
От Gregory Seidman
Тема more on timestamps
Дата
Msg-id 20020608013815.GA25607@jamaica.cs.brown.edu
обсуждение исходный текст
Список pgsql-general
Okay, I've come to the conclusion that I can manipulate timestamps in
almost all the ways I'd like to. The only issue I have is insertion. I'd
like to be able to insert an epoch-based value directly into a timestamp
field. It seems like I should be able to do that, but:

timemanage=> create table testing ( field timestamp with time zone);
CREATE
timemanage=> insert into testing values(1021780800);
ERROR:  column "field" is of type 'timestamp with time zone' but expression is of type 'integer'
        You will need to rewrite or cast the expression

According to http://www.postgresql.org/idocs/index.php?typeconv-query.html
it looks like the existence of timestamptz(int) (or maybe it's double
precision...) should allow the insertion, but it doesn't. Is there any way
to get PostgreSQL to automatically coerce an int (or double) to a
timestamptz on insertion?

--Greg


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Non-linear Performance
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: What popular, large commercial websites run