Re: bizarre AGE behaviour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: DHS Webmaster <webmaster(at)dhs-club(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: bizarre AGE behaviour
Date: 2004-03-03 23:19:19
Message-ID: 19029.1078355959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Steve Crawford <scrawford(at)pinpointresearch(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Mark Lubratt 2004-03-04 02:50:27 Multiple inserts without COPY
Previous Message Steve Crawford 2004-03-03 18:00:05 Re: bizarre AGE behaviour