Re: [BUGS] BUG #1871: operations with data types

2005-09-16 Thread Bruce Momjian
Added to TODO: o Fix SELECT INTERVAL '1' MONTH; --- Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > I just noticed something in PostgreSQL that might be considered > > surprising (although I do see "A

Re: [BUGS] BUG #1871: operations with data types

2005-09-13 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > I just noticed something in PostgreSQL that might be considered > surprising (although I do see "Add ISO INTERVAL handling" in the > TODO list): > test=> select interval '1' month; >interval > -- >00:00:00 > (1 row) > What's the

Re: [BUGS] BUG #1871: operations with data types

2005-09-13 Thread Michael Fuhr
On Sun, Sep 11, 2005 at 03:03:57AM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > What do other DBMSs do? > > This is a fair question. Given that the SQL committee hasn't provided > any useful leadership, what are other groups doing? I don't have access to an Oracle system

Re: [BUGS] BUG #1871: operations with data types

2005-09-11 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > [ Mike's unhappy that ] these give different answers: > select '2005-08-30'::date + '1 day'::interval + '1 month'::interval, >'2005-08-30'::date + '1 month'::interval + '1 day'::interval; This is certainly an arena in which you can't expect the c

Re: [BUGS] BUG #1871: operations with data types

2005-09-10 Thread Michael Fuhr
On Sun, Sep 11, 2005 at 12:43:58AM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > Apparently the two intervals don't cancel each other out (i.e., > > they're not optimized to zero), > > Well, no, because + and - associate left-to-right. Sure, I wasn't expecting any differen

Re: [BUGS] BUG #1871: operations with data types

2005-09-10 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > Apparently the two intervals don't cancel each other out (i.e., > they're not optimized to zero), Well, no, because + and - associate left-to-right. > so effectively we get this: > test=> select '2005-08-31'::date + '1 month'::interval; > ?column?

Re: [BUGS] BUG #1871: operations with data types

2005-09-10 Thread Michael Fuhr
On Fri, Sep 09, 2005 at 01:00:31PM +0100, [EMAIL PROTECTED] wrote: > select '2005-08-31'::date + '1 month'::interval-'1 month'::interval > > from the mathematical me the resulting value should be '2005-08-31' You didn't show any output; this is what I get: test=> select '2005-08-31'::date + '1 m

[BUGS] BUG #1871: operations with data types

2005-09-10 Thread
The following bug has been logged online: Bug reference: 1871 Logged by: Email address: [EMAIL PROTECTED] PostgreSQL version: 7-8 Operating system: Linux Description:operations with data types Details: May be it is not bug, but anywhere: here you are sample query