From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org, Brendan Jurd <direvus(at)gmail(dot)com>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: ISO week dates |
Date: | 2006-10-12 10:37:14 |
Message-ID: | 452E1ADA.60207@lelarge.info |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-patches |
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 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",
to_char(('2006-10-'||a+2)::date, 'ID') as "ID field",
to_char(('2006-10-'||a+2)::date, 'D') as "D field"
from generate_series(1, 15) as a;
dow | ID field | D field
-----------+----------+---------
TUESDAY | 2 | 3
WEDNESDAY | 3 | 4
THURSDAY | 4 | 5
FRIDAY | 5 | 6
SATURDAY | 6 | 7
SUNDAY | 7 | 1
MONDAY | 1 | 2
TUESDAY | 2 | 3
WEDNESDAY | 3 | 4
THURSDAY | 4 | 5
FRIDAY | 5 | 6
SATURDAY | 6 | 7
SUNDAY | 7 | 1
MONDAY | 1 | 2
TUESDAY | 2 | 3
(15 rows)
I just want to know if my patch is interesting... and if it's OK, I can
work on the ISO year field.
Regards.
--
Guillaume.
Attachment | Content-Type | Size |
---|---|---|
formatting2.patch | text/plain | 1.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Rafal Pietrak | 2006-10-12 10:38:08 | Re: STABLE functions |
Previous Message | Martijn van Oosterhout | 2006-10-12 10:26:47 | Re: List of supported 64bit OS |
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2006-10-12 10:43:00 | Re: [PATCHES] ISO week dates |
Previous Message | Hiroshi Saito | 2006-10-12 00:36:32 | warning: "min" redefined of qsort. |