Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B511B1337B50 for ; Wed, 29 Dec 2010 13:38:46 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 74749-04 for ; Wed, 29 Dec 2010 17:38:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm30.bullet.mail.sp2.yahoo.com (nm30.bullet.mail.sp2.yahoo.com [98.139.91.100]) by mail.postgresql.org (Postfix) with SMTP id D8E281337B49 for ; Wed, 29 Dec 2010 13:38:38 -0400 (AST) Received: from [98.139.91.62] by nm30.bullet.mail.sp2.yahoo.com with NNFMP; 29 Dec 2010 17:38:37 -0000 Received: from [98.139.91.2] by tm2.bullet.mail.sp2.yahoo.com with NNFMP; 29 Dec 2010 17:38:37 -0000 Received: from [127.0.0.1] by omp1002.mail.sp2.yahoo.com with NNFMP; 29 Dec 2010 17:38:37 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 846676.93131.bm@omp1002.mail.sp2.yahoo.com Received: (qmail 10828 invoked by uid 60001); 29 Dec 2010 17:38:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1293644317; bh=qMpx6SOTZVAvxdrwQtBwIzN5X+NridmYLV0XoH5zS6g=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=m2hvrZi5nvq3VJthCNx8yPaeWhz6xaV0OFQpyluLIImvmJLXOqEJhRz3b+X3jUDjPNn/3QjGEWHHT7mhfX5XTaZYlUeFFdUm/sstAbirxF8W1e6ClYDKXXI/1z2vJuPI/1Te64kQWjXP1eNKKmDqQg6wQrrd3P3FT9iD7c+Umcs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=4JPYOADHH7PePkdp/3sSANKuWLae7iDajgl+sEP0UgVx/mcwSgGGeYvKSi4SkgTxr/y4xWgVfBIgEcA2WMzkaCStrsXGb3bpxyi7UQeoGPRmgySpBdA7izqQiehH8hUCgZg9ZmO2LrDC6ZlZADlRpMy/4goPu+1JOvuHlFfKeOI=; Message-ID: <489318.10800.qm@web110704.mail.gq1.yahoo.com> X-YMail-OSG: .PvCuGwVM1kTKOExGk05Bmzftv.8_jU1xwrZZKc3TbKineG A3T.i.tDVLKUaYCiuNdGAC_mUMrFR1SkGksUZKGIpFIcjGpuexJOnFdtnWlB .ePWbGLYH6r5.G5OvQ1nHfFvm9fmfsHhxV9tI.vqw8ydEuaGcPxDPn6LmxF0 k.T..BaovuQ5bHNfRIBRsPpIy2zbA3n1PFAmNWFQyKC5NxqmHSZx9kwvMybP l9G5s_E4NZ1pLujdWqKE3aVtvIFMyHJc5JqPesvmGxD3MzuMQJnMofcHgh29 ZD4J6GD_uxVkabtZ_9T.l_8J5WOGrbwIjXf51d1ojJ4qmPqXhYxQQIUHMqYT cUC_.7ftfcdxECjfF8.KZOpkWZQjsU249N617xN7YFexTe6pVxEYZtmV0PxK qi9dkI6Q6axk- Received: from [65.94.247.127] by web110704.mail.gq1.yahoo.com via HTTP; Wed, 29 Dec 2010 09:38:36 PST X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Wed, 29 Dec 2010 09:38:36 -0800 (PST) From: Leslie S Satenstein Subject: Re: Some comments about Julian Dates and possible bug. Please provide feedback. To: Robert Haas , Postgres documentation In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.908 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/50 X-Sequence-Number: 6286 Good morning Robert=0A=0AI presume that you are the acting project manager,= in the sense of vetting changes or commentary. The pdf guide has only one= statement concerning julian dates. I feel that more is required.=0A=0AJul= ian dates are used as follows.=0A=0AWorking days between two dates is (the = difference of the day numbers * 5/7) , with minor adjustment for rounding a= nd weekend start-end considerations. =0A=0AJulian date conversion is used f= or this type of calculation. It would be nice to see more in the manual ab= out Julian dates, such as tests if a day is a weekend day, or to determine = the day of the week for a specific Gregorian calendar date and vice-versa.= =0A=0ARegarding the julian bug(let), I will raise it as a comment on the co= de buglist.=0A=0A =0A=0A=0A------------------=0A=0ARegards =0A=A0Leslie=0A= Mr. Leslie Satenstein=0A=0A=A0=0Amailto:lsatenstein@yahoo.com=0Amailto les= lie.satenstein@itbms.biz / leslies@itbms.biz=0Awww.itbms.biz=0A =0A=0A=0A--= - On Wed, 12/29/10, Robert Haas wrote:=0A=0A> From:= Robert Haas =0A> Subject: Re: [DOCS] Some comments = about Julian Dates and possible bug. Please provide feedback.=0A> To: "Lesl= ie S Satenstein" =0A> Cc: "pgsql-docs" =0A> Date: Wednesday, December 29, 2010, 6:58 AM=0A> On Mon, = Dec 27, 2010 at 9:23 PM,=0A> Leslie S Satenstein=0A> =0A> wrote:=0A> > I found the Julian date code that is programmed in=0A> P= ostgres, to be accurate and fast except for one situation.=0A> But, I do ha= ve one or two questions. 1) Which calendar is=0A> being used?=0A> >=0A> > I= n the Gregorian Calendar, =A0January 1, 0001 is lowest=0A> positive date.= =0A> > The day before 1/1/0001, according to the Gregorian=0A> calendar is = December 31,-0001 in which the year has a value=0A> of negative one --- the= re is no zero year in the Gregorian=0A> Calendar. (zero year is an error)= =0A> >=0A> > I tested and found the algorithm in Postgres to have=0A> the d= ay before January 1,0001 calculating as December=0A> 31,0000 even though th= e world calculates the day before=0A> January 1,0001 as December 31,-0001.= =0A> >=0A> > 2) Is the algorithm in Postgres correct? =A0I think=0A> not, a= s the calculations for the difference in days between=0A> January 1, 0001 a= nd December 31,-0001 is not 367 days, but=0A> just the value 1.=0A> >=0A> >= To convert the code to work with the Gregorian=0A> calendar takes two fixe= s to two sub-routines. Each fix is=0A> two lines of C code.=0A> >=0A> > I h= ave tested the PG Date C language routines=0A> with/without my fix, startin= g with the year around -4713 to=0A> several centuries into the future. As l= ong as both versions=0A> calculate Julian dates that are later than 1/1/000= 1, both=0A> the PG and my fixed versions respecting Gregorian algorithms=0A= > produce identical results.=0A> >=0A> > 3) Does PG want to fully follow th= e Gregorian Calendar=0A> rule? =A0If so,=0A> > 4) do they want my one patch= with two fixes6=0A> =0A> This seems like it'd be more appropriate for pgsq= l-bugs or=0A> pgsql-hackers rather than here.=A0 I can't really figure=0A> = out exactly=0A> what change you're proposing, so I'm not entirely sure=0A> = whether it's=0A> right or wrong.=A0 Perhaps you could post your patch,=0A> = and some examples.=0A> =0A> -- =0A> Robert Haas=0A> EnterpriseDB: http://ww= w.enterprisedb.com=0A> The Enterprise PostgreSQL Company=0A> =0A> -- =0A> S= ent via pgsql-docs mailing list (pgsql-docs@postgresql.org)=0A> To make cha= nges to your subscription:=0A> http://www.postgresql.org/mailpref/pgsql-doc= s=0A>