Re: [HACKERS] age() function documentation

2001-04-12 Thread Peter Eisentraut
Thomas Lockhart writes: > Typical date/time arithmetic resolves to an absolute time or interval. > In those cases, *qualitative* quantities such as years and months are > resolved to a specific absolute interval at the time of calculation. > > The age() functions *preserve* the qualitative fields

Re: [HACKERS] age() function documentation

2001-04-12 Thread Peter Eisentraut
Thomas Lockhart writes: > > b) date substraction not implemented at all (it does date - integer) > > No, and changing what it *does* do has ramifications. Okay, I see there's 'date - date' after all. But 'date - date' should still return some kind of time interval, not an integer. Of course ch

Re: [HACKERS] age() function documentation

2001-04-12 Thread Thomas Lockhart
> ISTM that this is more a result of > a) timestamp subtraction not implemented per spec Maybe. But it is implemented consistantly, and is more functional and capable than the brain-damaged SQL9x spec (c.f. Date and Darwen) asks. > b) date substraction not implemented at all (it does date - inte

Re: [HACKERS] age() function documentation

2001-04-12 Thread Peter Eisentraut
Thomas Lockhart writes: > The age() functions *preserve* the qualitative fields year and month. So > you see the difference in results: > > lockhart=# select age('today', '1957-06-13'); > - > 43 years 9 mons 28 days > > lockhart=# select timestamp 'today' - timestamp '195

Re: [HACKERS] age() function documentation

2001-04-11 Thread Thomas Lockhart
> As you see in one of the examples I posted, it does not preserve years and > months. What exactly does that mean anyway? Simple subtraction also > preserves years and months, as I see it. OK, so there is a documentation problem, since the functions do exactly what they claim! What do you mea

Re: [HACKERS] age() function documentation

2001-04-11 Thread Bruce Momjian
> Thomas Lockhart writes: > > > Why do you have a problem with the age() function? It *does* behave > > differently than date subtraction, as explicitly mentioned in the docs > > (preserving years, etc etc). > > As you see in one of the examples I posted, it does not preserve years and > months.

Re: [HACKERS] age() function documentation

2001-04-11 Thread Peter Eisentraut
Thomas Lockhart writes: > Why do you have a problem with the age() function? It *does* behave > differently than date subtraction, as explicitly mentioned in the docs > (preserving years, etc etc). As you see in one of the examples I posted, it does not preserve years and months. What exactly d

Re: [HACKERS] age() function documentation

2001-04-11 Thread Peter Eisentraut
Thomas Lockhart writes: > I notice that the docs have commented-out all mention of the age() > functions, with the note that "These two functions don't seem to do what > it says here, or anything reasonable at all for that matter." > > ?? > > How did we conclude that, and how could these be confu

Re: [HACKERS] age() function documentation

2001-04-11 Thread Thomas Lockhart
> > > http://www.postgresql.org/mhonarc/pgsql-hackers/2001-02/msg00550.html OK, so that narrows down the list of suspects ;) Why do you have a problem with the age() function? It *does* behave differently than date subtraction, as explicitly mentioned in the docs (preserving years, etc etc). Wo