Skip site navigation (1) Skip section navigation (2)

Re: Top five challenges

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: silly sad <sad(at)bestmx(dot)ru>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-advocacy <pgsql-advocacy(at)postgresql(dot)org>
Subject: Re: Top five challenges
Date: 2011-03-10 17:48:46
Message-ID: 4D790EFE.2070602@gmail.com (view raw or flat)
Thread:
Lists: pgsql-advocacypgsql-www
On 03/10/2011 09:15 AM, silly sad wrote:
> On 03/10/11 20:07, Adrian Klaver wrote:
>> On 03/10/2011 08:53 AM, silly sad wrote:
>>
>>
>>>>
>>>> Well, 'epoch' clearly is a point in time with the hour being midnight at
>>>> GMT, so I don't see a problem with epoch making such an adjustment:
>>>
>>>
>>> great! the flexible epoch!
>>>
>>> when do want to point an epoch to?
>>> just set timezone and enjoy.
>>>
>>
>> I am not sure what your point is.
>
> my point is:
>
> SELECT extract('epoch' from 'epoch'::timestamp);

Simplest explanation is you are comparing a time zone aware datetime 
'epoch' to an unaware one 'epoch'::timezone.  The second one, since it 
is not anchored to a time zone is taken to be local time and the result 
you get is the interval in seconds between the two.

Try:

test=> SELECT extract(EPOCH  from 'epoch'::timestamptz);
  date_part
-----------
          0

or

test=> SELECT extract(EPOCH  from 'epoch'::timestamp at time zone 'utc');
  date_part
-----------
          0


-- 
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

pgsql-www by date

Next:From: Adrian KlaverDate: 2011-03-10 17:52:47
Subject: Re: Top five challenges
Previous:From: Merlin MoncureDate: 2011-03-10 17:22:23
Subject: Re: Read uncommitted ever possible?

pgsql-advocacy by date

Next:From: Adrian KlaverDate: 2011-03-10 17:52:47
Subject: Re: Top five challenges
Previous:From: silly sadDate: 2011-03-10 17:15:34
Subject: Re: Top five challenges

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group