رد: BUG #16419: wrong parsing BC year in to_date() function - Mailing list pgsql-bugs

From دار الآثار للنشر والتوزيع-صنعاء Dar Alathar-Yemen
Subject رد: BUG #16419: wrong parsing BC year in to_date() function
Date
Msg-id AM0PR03MB3570B2972F6AD51245CA0ADCBFA50@AM0PR03MB3570.eurprd03.prod.outlook.com
Whole thread Raw
In response to Re: BUG #16419: wrong parsing BC year in to_date() function  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs

To make "to_date" work as "make_date" with negative years these llines:

https://github.com/postgres/postgres/blob/fb544735f11480a697fcab791c058adc166be1fa/src/backend/utils/adt/formatting.c#L4559-L4560 :

                                            if (tmfc.bc && tm->tm_year > 0)

                                                           tm->tm_year = -(tm->tm_year - 1);

must be changed to:

                                            if (tmfc.bc && tm->tm_year > 0)

                                            {

                                                           tm->tm_year = -(tm->tm_year - 1);

                                            }

                                            else if (tm->tm_year < 0) {

                                                           tm->tm_year ++;

                                             }

 

 

pgsql-bugs by date:

Previous
From: Fahar Abbas
Date:
Subject: Re: BUG #16420: problem running into post install step while installation.
Next
From: PG Bug reporting form
Date:
Subject: BUG #16421: Table Rapid Growth due to tuple accumulation