Re: Yet Another Timestamp Question: Time Defaults

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Yet Another Timestamp Question: Time Defaults
Дата
Msg-id 9154.1358796454@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Yet Another Timestamp Question: Time Defaults  (Adrian Klaver <adrian.klaver@gmail.com>)
Ответы Re: Yet Another Timestamp Question: Time Defaults  (Rich Shepard <rshepard@appl-ecosys.com>)
Re: Yet Another Timestamp Question: Time Defaults  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: Yet Another Timestamp Question: Time Defaults  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
Adrian Klaver <adrian.klaver@gmail.com> writes:
> On 01/21/2013 07:26 AM, Rich Shepard wrote:
>> What is the behavior if a column data type is timestamptz but there is
>> only the date portion available? There must be a default time; can that be
>> defined?

> Easy enough to test:

> test=# create table ts_test(ts_fld timestamp with time zone);
> CREATE TABLE

> test=# insert into ts_test VALUES ('2013-01-21');
> INSERT 0 1

> test=# SELECT * from ts_test ;
>           ts_fld
> ------------------------
>   2013-01-21 00:00:00-08

Note that that default is local midnight according to your current
timezone setting (from which we may guess that Adrian lives on the US
west coast, or somewhere in that general longitude).

> Not sure you can change the default supplied by Postgres,

"SET timezone" ought to do it ...

            regards, tom lane


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

Предыдущее
От: Edson Richter
Дата:
Сообщение: Re: What is impact of "varchar_opts"?
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Yet Another Timestamp Question: Time Defaults