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

Re: date_part returns different results with same interval.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: archeron(at)wavefire(dot)com
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: date_part returns different results with same interval.
Date: 2004-02-21 04:53:14
Message-ID: 9196.1077339194@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Wade Klaver <archeron(at)wavefire(dot)com> writes:
> I guess what I am trying 
> to say is that the date_part() call is how you determine what you are 
> asking...  If I want to get the number of years, it shouldn't matter if my 
> interval is '1 year, 1 month' or '396 days', they both contain 1 year.

I think you missed the point.  If I want to get the number of months,
it's clear what the answer is for an interval of '1 year', but not at
all clear what the answer is for an interval of '60 days'.  Months and
days don't have a fixed conversion factor.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-02-21 06:51:07
Subject: Re: Mac OS X, PostgreSQL, PL/Tcl
Previous:From: Scott GoodwinDate: 2004-02-21 04:34:37
Subject: Mac OS X, PostgreSQL, PL/Tcl

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