Re: BUG #1332: wrong results from age function - Mailing list pgsql-bugs

From Bruno Wolff III
Subject Re: BUG #1332: wrong results from age function
Date
Msg-id 20041201084519.GB20166@wolff.to
Whole thread Raw
In response to BUG #1332: wrong results from age function  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
Responses Re: BUG #1332: wrong results from age function  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Mon, Nov 29, 2004 at 11:37:50 +0000,
  PostgreSQL Bugs List <pgsql-bugs@postgresql.org> wrote:
>
> The following bug has been logged online:
>
> Bug reference:      1332
> Logged by:          Robert Grabowski
>
> Email address:      grabba@env.pl
>
> PostgreSQL version: 7.4.6
>
> Operating system:   Linux
>
> Description:        wrong results from age function
>
> Details:
>
> select age('2004-02-01'::date, '2004-01-01'::date);
>   age
> -------
>  1 mon
> (1 row)
>
> select age('2004-03-01'::date, '2004-02-01'::date);
>    age
> ---------
>  29 days
> (1 row)
>
> I think, it should be "1 mon".

I get "1 mon" when I try this:
Welcome to psql 7.4.6, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

area=> select age('2004-03-01'::date, '2004-02-01'::date);
  age
-------
 1 mon
(1 row)

I am actually using a version post 7.4.6 from cvs. I have also built
postgres using integer date time values.

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #1334: PREPARE creates bad execution plan (40x
Next
From: "Magnus Hagander"
Date:
Subject: Re: BUG #1319: Windows LIB file libecpg.lib not in build or package