Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-17 Thread Stephen R. van den Berg
Tom Lane wrote: Ron Mayer [EMAIL PROTECTED] writes: Tom Lane wrote: If I read SQL 200N's spec correctly select interval '-1 1:00:00'; should mean-1 days -1 hours, yet 8.3 sees it as -1 days +1 hours. I think we are kind of stuck on this one. If we change it, then how would one

Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-17 Thread Tom Lane
Stephen R. van den Berg [EMAIL PROTECTED] writes: Intervals are a scalar, not an addition of assorted values, alternating signs between fields would be wrong. Sorry, you're the one who's wrong on that. We've treated intervals as three independent fields for years now (and before that it was

Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-17 Thread Ron Mayer
Tom Lane wrote: Stephen R. van den Berg [EMAIL PROTECTED] writes: Intervals are a scalar, not an addition of assorted values, alternating signs between fields would be wrong. Sorry, you're the one who's wrong on that. We've treated intervals as three independent fields for years now (and

Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-17 Thread Stephen R. van den Berg
Tom Lane wrote: Stephen R. van den Berg [EMAIL PROTECTED] writes: Intervals are a scalar, not an addition of assorted values, alternating signs between fields would be wrong. Sorry, you're the one who's wrong on that. We've treated intervals as three independent fields for years now (and

[HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-16 Thread Ron Mayer
Tom Lane wrote: ... SQL-spec interval literals. I decided to go look at exactly how unfinished it was, and it turns out that it's actually pretty close. Hence the attached proposed patch ;-) Short summary: I think this patch fixes a bug with sql-spec negative interval literals. Longer. I

Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-16 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: Short summary: I think this patch fixes a bug with sql-spec negative interval literals. Hmm. I'm a bit concerned about possible side-effects on other cases: what had been seen as two separate tokens will now become one token for *all* datetime types, not

Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-16 Thread Ron Mayer
Tom Lane wrote: Ron Mayer [EMAIL PROTECTED] writes: Short summary: I think this patch fixes a bug with sql-spec negative interval literals. Hmm. I'm a bit concerned about possible side-effects on other cases: what had been seen as two separate tokens will now become one token for *all*

Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-16 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: Tom Lane wrote: Hmm. I'm a bit concerned about possible side-effects on other cases: what had been seen as two separate tokens will now become one token for *all* datetime types, not just interval. However, I can't If it's a concern, I could make

Re: [HACKERS] Patch for SQL-standard negative valued year-month literals

2008-09-16 Thread Ron Mayer
Tom Lane wrote: If I read SQL 200N's spec correctly select interval '-1 1:00:00'; should mean-1 days -1 hours, yet 8.3 sees it as -1 days +1 hours. I think we are kind of stuck on this one. If we change it, then how would one represent -1 days +1 hours? The spec's format is only