Re: Daylight Savings Time handling on persistent connections

Поиск
Список
Период
Сортировка
От Randall Nortman
Тема Re: Daylight Savings Time handling on persistent connections
Дата
Msg-id 20041031170558.GY23033@li2-47.members.linode.com
обсуждение исходный текст
Ответ на Re: Daylight Savings Time handling on persistent connections  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Daylight Savings Time handling on persistent connections  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Sun, Oct 31, 2004 at 11:52:03AM -0500, Tom Lane wrote:
> Randall Nortman <postgreslists@wonderclown.com> writes:
> > My suspicion is that Postgres calculates the local offset from UTC
> > only once per session, during session initialization.
>
> This is demonstrably not so.  We might be able to figure out what
> actually went wrong, if you would show us the exact commands your
> application issued.

I can't reproduce the error without messing up my clock, but from my
logs, here's the text of the SQL sent to the server:

insert into sensor_readings_numeric (sensor_id, reading_ts, reading,
min, max) values (3, '2004-10-31 01:00:00', 0.540602, 0.519071837254,
0.551811824539)

And this came back:

ERROR:  duplicate key violates unique constraint "sensor_readings_numeric_pkey"

Table definition:

                               Table "public.sensor_readings_numeric"
   Column   |           Type           |
   Modifiers
------------+--------------------------+-------------------------------------------------------------
 sensor_id  | integer                  | not null
 reading_ts | timestamp with time zone | not null default ('now'::text)::timestamp(6) with time zone
 reading    | numeric                  | not null
 min        | numeric                  |
 max        | numeric                  |
Indexes:
    "sensor_readings_numeric_pkey" primary key, btree (reading_ts, sensor_id)
Foreign-key constraints:
    "$1" FOREIGN KEY (sensor_id) REFERENCES sensors(sensor_id)


I'll try to set up a system where I can play around with the clock to
see if I can reproduce the error, but it'll probably be a few days at
least before I can do that.  There's no hurry for me, since this won't
happen again until next year.

Thanks,

Randall Nortman

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Daylight Savings Time handling on persistent connections
Следующее
От: Vinko Vrsalovic
Дата:
Сообщение: Re: Superuser log-in through a web interface?