Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Alvaro Herrera
Bruce Momjian escribió: Followup --- something weird is going on. I am seeing _random_ failures of the regression tests here in that same place, and the build farm seems to fail in the same place, but with different row counts. This failure is pretty interesting: --- 724,730

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Andrew Dunstan
Alvaro Herrera wrote: Bruce Momjian escribió: Followup --- something weird is going on. I am seeing _random_ failures of the regression tests here in that same place, and the build farm seems to fail in the same place, but with different row counts. This failure is pretty

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Alvaro Herrera
Andrew Dunstan escribió: Looks to me like the timestamptz test relies on the timestamp test (for timestamp_tbl) but they are set to run in parallel, so we have a race condition. Oops! Good catch :-) I'd guess the answer is to move the tests using the timestamp_tbl to the timestamp test.

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Bruce Momjian
Alvaro Herrera wrote: Andrew Dunstan escribi?: Looks to me like the timestamptz test relies on the timestamp test (for timestamp_tbl) but they are set to run in parallel, so we have a race condition. Oops! Good catch :-) I'd guess the answer is to move the tests using the

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Alvaro Herrera
Bruce Momjian escribió: Alvaro Herrera wrote: Andrew Dunstan escribi?: Looks to me like the timestamptz test relies on the timestamp test (for timestamp_tbl) but they are set to run in parallel, so we have a race condition. Oops! Good catch :-) I'd guess the answer is to

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Andrew Dunstan
Alvaro Herrera wrote: Bruce Momjian escribió: Alvaro Herrera wrote: Andrew Dunstan escribi?: Looks to me like the timestamptz test relies on the timestamp test (for timestamp_tbl) but they are set to run in parallel, so we have a race condition. Oops! Good catch :-)

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Bruce Momjian
Alvaro Herrera wrote: Bruce Momjian escribi?: Alvaro Herrera wrote: Andrew Dunstan escribi?: Looks to me like the timestamptz test relies on the timestamp test (for timestamp_tbl) but they are set to run in parallel, so we have a race condition. Oops! Good catch :-)

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Alvaro Herrera
Andrew Dunstan escribió: Alvaro Herrera wrote: Bruce Momjian escribió: Alvaro Herrera wrote: Andrew Dunstan escribi?: Looks to me like the timestamptz test relies on the timestamp test (for timestamp_tbl) but they are set to run in parallel, so we have a race

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Alvaro Herrera
Bruce Momjian escribió: Maybe now would be an appropriate time to discuss the open questions in the submitting email: Brendan Jurd wrote: I have tried to implement these features with as little disruption to the existing code as possible. I built on the existing date2iso* functions

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Bruce Momjian
Alvaro Herrera wrote: The same situation can arise if the user mixes ISO and Gregorian data; how should Postgres deal with something like to_date('2006-250', 'IYYY-DDD')? The current behaviour in my patch is actually to assume that the user meant to say 'IYYY-IDDD', since the

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Andrew Dunstan escribió: Well, the first question is which table should these tests actually be using, and why? Then they can be changed or moved as appropriate. I just committed my patch before reading this comment. Maybe it was rushed. Yes, it

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Bruce Momjian
Brendan Jurd wrote: On 2/17/07, Tom Lane [EMAIL PROTECTED] wrote: Yes, it was: you now have two duplicate tests in timestamp.sql, and no corresponding test in timestamptz.sql. It looks to me like the submitter intended to be testing timestamp_tbl in the former file and the same tests

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Alvaro Herrera
Brendan Jurd escribió: On 2/17/07, Tom Lane [EMAIL PROTECTED] wrote: Yes, it was: you now have two duplicate tests in timestamp.sql, and no corresponding test in timestamptz.sql. It looks to me like the submitter intended to be testing timestamp_tbl in the former file and the same tests

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Brendan Jurd
On 2/17/07, Alvaro Herrera [EMAIL PROTECTED] wrote: Thanks for the clarification. Would you have a look at the tests as they are now and confirm that that's what you wanted? Yes, the tests in HEAD right now are what I wanted. Although, while I was in there I did notice a minor thing

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-16 Thread Bruce Momjian
Applied. --- Brendan Jurd wrote: On 2/17/07, Alvaro Herrera [EMAIL PROTECTED] wrote: Thanks for the clarification. Would you have a look at the tests as they are now and confirm that that's what you wanted? Yes,

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-15 Thread Bruce Momjian
Patch applied. Thanks. --- Brendan Jurd wrote: The attached patch implements my proposal to extend support for the ISO week date calendar. I have added two new format fields for use with to_char, to_date and

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-15 Thread Bruce Momjian
I am seeing buildfarm failures from the new regression tests added by this patch. Would someone research why this is happening? http://www.pgbuildfarm.org/cgi-bin/show_status.pl --- bruce wrote: Patch applied.

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-15 Thread Bruce Momjian
Followup --- something weird is going on. I am seeing _random_ failures of the regression tests here in that same place, and the build farm seems to fail in the same place, but with different row counts. I am heading to bed but when I wake up, if it still an issue, I will revert the patch.

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Bruce Momjian
Peter Eisentraut wrote: Bruce Momjian wrote: On these questions, we have to find out how Oracle handles it, but your approach seems appropriate. I don't think Oracle even has that. But personally I'd like to see errors for invalid pattern combinations. What do we do with other invalid

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: I don't think Oracle even has that. But personally I'd like to see errors for invalid pattern combinations. What do we do with other invalid pattern combinations in to_char() now? Mostly, we return bogus results :-(. The

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: I don't think Oracle even has that. But personally I'd like to see errors for invalid pattern combinations. What do we do with other invalid pattern combinations in to_char() now? Mostly, we return

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Brendan Jurd
On 2/15/07, Bruce Momjian [EMAIL PROTECTED] wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: I don't think Oracle even has that. But personally I'd like to see errors for invalid pattern combinations. What do we do with other invalid pattern

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Bruce Momjian
Brendan Jurd wrote: On 2/15/07, Bruce Momjian [EMAIL PROTECTED] wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: I don't think Oracle even has that. But personally I'd like to see errors for invalid pattern combinations. What do we do

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Bruce Momjian
Bruce Momjian wrote: Brendan Jurd wrote: On 2/15/07, Bruce Momjian [EMAIL PROTECTED] wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: I don't think Oracle even has that. But personally I'd like to see errors for invalid pattern

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Brendan Jurd
On 2/15/07, Bruce Momjian [EMAIL PROTECTED] wrote: Bruce Momjian wrote: Brendan Jurd wrote: On 2/15/07, Bruce Momjian [EMAIL PROTECTED] wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: I don't think Oracle even has that. But personally

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-14 Thread Bruce Momjian
Brendan Jurd wrote: On 2/15/07, Bruce Momjian [EMAIL PROTECTED] wrote: Bruce Momjian wrote: Brendan Jurd wrote: On 2/15/07, Bruce Momjian [EMAIL PROTECTED] wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: I don't think Oracle

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-13 Thread Bruce Momjian
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews and approves it. ---

Re: [PATCHES] [GENERAL] ISO week dates

2007-02-13 Thread Peter Eisentraut
Bruce Momjian wrote: On these questions, we have to find out how Oracle handles it, but your approach seems appropriate. I don't think Oracle even has that. But personally I'd like to see errors for invalid pattern combinations. -- Peter Eisentraut http://developer.postgresql.org/~petere/

Re: [PATCHES] [GENERAL] ISO week dates

2006-11-08 Thread Guillaume Lelarge
Brendan Jurd a écrit : On 10/13/06, Guillaume Lelarge [EMAIL PROTECTED] wrote: Peter Eisentraut a écrit : There is an inconsistency here: 'IYYY' is the four-digit ISO year, 'IW' is the two-digit ISO week, but 'ID' would be the one-digit ISO day-of-the-week. I'm not sure we can fix

Re: [PATCHES] [GENERAL] ISO week dates

2006-11-08 Thread Brendan Jurd
On 11/9/06, Guillaume Lelarge [EMAIL PROTECTED] wrote: Brendan Jurd a écrit : I will take a look at implementing 'isoyear' for extract(), and also start putting together a patch for the documentation. If Guillaume is still interested in adding the IDDD field to to_char(), wonderful, if not

Re: [PATCHES] [GENERAL] ISO week dates

2006-11-05 Thread Brendan Jurd
On 10/13/06, Guillaume Lelarge [EMAIL PROTECTED] wrote: Peter Eisentraut a écrit : There is an inconsistency here: 'IYYY' is the four-digit ISO year, 'IW' is the two-digit ISO week, but 'ID' would be the one-digit ISO day-of-the-week. I'm not sure we can fix that, but I wanted to point it

Re: [PATCHES] [GENERAL] ISO week dates

2006-10-16 Thread Guillaume Lelarge
Guillaume Lelarge a ecrit le 12/10/2006 20:20: Peter Eisentraut a écrit : We should also support a format for ISO day-of-the-year, which might be 'IDDD'. I will work tomorrow on this one. Don't we already have it ? It seems ISO day-of-the-year is between 001 and 366 in leap years. Isn't

Re: [PATCHES] [GENERAL] ISO week dates

2006-10-16 Thread Peter Eisentraut
Guillaume Lelarge wrote: Guillaume Lelarge a ecrit le 12/10/2006 20:20: Peter Eisentraut a écrit : We should also support a format for ISO day-of-the-year, which might be 'IDDD'. I will work tomorrow on this one. Don't we already have it ? It seems ISO day-of-the-year is between 001

Re: [PATCHES] [GENERAL] ISO week dates

2006-10-12 Thread Guillaume Lelarge
Peter Eisentraut a ecrit le 07/10/2006 09:01: Brendan Jurd wrote: * add an ISO day format pattern to to_char() called 'ID', which starts at Monday = 1, and * add an ISO year field to extract() called 'isoyear'? That seems reasonable. Do you volunteer? I've tried to work on the first

Re: [PATCHES] [GENERAL] ISO week dates

2006-10-12 Thread Heikki Linnakangas
Guillaume Lelarge wrote: I've tried to work on the first one, the ISO day field. My patch is attached and is against CVS HEAD. It only takes care of the code, nothing is done for documentation matter. It works with me : I haven't been following this thread, but I just wanted to point out

Re: [PATCHES] [GENERAL] ISO week dates

2006-10-12 Thread Guillaume Lelarge
Heikki Linnakangas a ecrit le 12/10/2006 12:43: Guillaume Lelarge wrote: I've tried to work on the first one, the ISO day field. My patch is attached and is against CVS HEAD. It only takes care of the code, nothing is done for documentation matter. It works with me : I haven't been following

Re: [PATCHES] [GENERAL] ISO week dates

2006-10-12 Thread Peter Eisentraut
Guillaume Lelarge wrote: I've tried to work on the first one, the ISO day field. My patch is attached and is against CVS HEAD. It only takes care of the code, nothing is done for documentation matter. It works with me : toto=# select to_char(('2006-10-'||a+2)::date, 'DAY') as dow,

Re: [PATCHES] [GENERAL] ISO week dates

2006-10-12 Thread Guillaume Lelarge
Peter Eisentraut a écrit : Guillaume Lelarge wrote: I've tried to work on the first one, the ISO day field. My patch is attached and is against CVS HEAD. It only takes care of the code, nothing is done for documentation matter. It works with me : toto=# select