Re: bizarre AGE behaviour - Mailing list pgsql-admin

From Tom Lane
Subject Re: bizarre AGE behaviour
Date
Msg-id 19029.1078355959@sss.pgh.pa.us
Whole thread Raw
In response to Re: bizarre AGE behaviour  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: bizarre AGE behaviour  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-admin
Steve Crawford <scrawford@pinpointresearch.com> writes:
> US Daylight Saving Time starts this year on April 4 when 0200 jumps to
> 0300. The answers PostgreSQL gave are correct.

I suspect what the OP wants is non-timezone-aware behavior, which he
could get by casting the inputs of age() to timestamp without time
zone.  As written the system is preferring to interpret them as
timestamp with time zone.

Also, if what's really wanted is just resolution to the day level,
the date subtraction operator might be a lot better choice than
age() anyway.

regression=# select '06-01-04'::date - '04-01-04'::date;
 ?column?
----------
       61
(1 row)


            regards, tom lane

pgsql-admin by date:

Previous
From: Steve Crawford
Date:
Subject: Re: bizarre AGE behaviour
Next
From: Mark Lubratt
Date:
Subject: Multiple inserts without COPY