Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2020-03-23 Thread Mark Lorenz
Hi Tom, with a bit space to this issue, I re-read your comments. I am beginning to understand what you mean or - better - what's wrong with my thoughts. When I understand you correctly, you say, the WW can start at any weekday, and is not fixed to Sunday, right? In your opinion the WW starts

Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2020-01-10 Thread Mark Lorenz
f%40four-two.de is still up-to-date)From 4e35bd88bef1916e7d11ad0776b3075e3183f7d0 Mon Sep 17 00:00:00 2001 From: Mark Lorenz Date: Fri, 20 Dec 2019 14:30:41 +0100 Subject: [PATCH 1/3] change to_date()/to_timestamp() behaviour with '-WW-D' pattern Currently, the D part is ignored at

Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2019-12-20 Thread Mark Lorenz
while preparing the patch for the Commitfest, I found a bug in the to_char() function that is quite correlated with this issue: SELECT to_char('1997-02-01'::date, '-WW-D') returns: 1997-05-7 -> which is ok, I believe. Feb, 1st was on Saturday, so counting from Sundays, it was day 7 of w

Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2019-12-20 Thread Mark Lorenz
Hi Tom, thanks for answering! I commited two different patches: --- The first one is for the strange behaviour of to_char(), which could be seen as a bug, I believe. As described earlier, to_char() with the 'WW-D' pattern could return wrong week numbers. The non-ISO week number is defi

Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2019-12-20 Thread Mark Lorenz
Hi, I got the advice to split the patches for: - fixing the to_char() function - changing the to_date()/to_timestamp() behaviour So I appended the split patches. Kind regards, Mark Lorenz From 4e35bd88bef1916e7d11ad0776b3075e3183f7d0 Mon Sep 17 00:00:00 2001 From: Mark Lorenz Date: Fri, 20

Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2019-12-20 Thread Mark Lorenz
5 (1 row) postgres=# SELECT to_date('2019-2-1', '-WW-D'); to_date 2019-01-06 (1 row) I added the patch as plain text attachment. It contains the code and, of course, the regression tests. Some existing tests failed, because they worked with the old out

Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2019-12-20 Thread Mark Lorenz
T to_char('1997-02-10'::date, '-WW-D') This is wrong, because this should be week 7 instead. On the other hand, the ISO week formats work very well. I'll have a look at the code and try to fix it in the patch as well. Kind regards, Mark Am 2019-10-08 17:49, s

Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

2019-10-08 Thread Mark Lorenz
Hi, I apologize for the mistake. For the mailing list correspondence I created this mail account. But I forgot to change the sender name. So, the "postgres" name appeared as sender name in the mailing list. I changed it. Kind regards, Mark/S-Man42 Hi, some days ago I ran into a problem wi