Skip site navigation (1) Skip section navigation (2)

Re: ISO week dates

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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: formatting2.patch
Description: text/plain (1.1 KB)

In response to

Responses

pgsql-patches by date

Next:From: Heikki LinnakangasDate: 2006-10-12 10:43:00
Subject: Re: [PATCHES] ISO week dates
Previous:From: Hiroshi SaitoDate: 2006-10-12 00:36:32
Subject: warning: "min" redefined of qsort.

pgsql-general by date

Next:From: Rafal PietrakDate: 2006-10-12 10:38:08
Subject: Re: STABLE functions
Previous:From: Martijn van OosterhoutDate: 2006-10-12 10:26:47
Subject: Re: List of supported 64bit OS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group