PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16216
PG Version12.0
OScentos7
Opened2020-01-17 12:42:19+00
Reported byzhongxuan sun
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16216
Logged by:          zhongxuan sun
Email address:      (redacted)
PostgreSQL version: 12.0
Operating system:   centos7
Description:        

example:
postgres=# select to_date('-120', 'yyyy');
    to_date    
---------------
 0121-01-01 BC
(1 row)

postgres=# select to_date('120bc', 'yyyybc'); 
    to_date    
---------------
 0120-01-01 BC
(1 row)

I think -120 means 120bc, however, the output is 121bc not 120bc.

Thanks~

Messages

DateAuthorSubject
2020-01-17 12:42:19+00PG Bug reporting formBUG #16216: the result of to_date function with negative year number not same as BC year number
2020-01-17 14:17:34+00Fabien COELHORe: BUG #16216: the result of to_date function with negative year number not same as BC year number
2020-01-17 14:59:42+00Tom LaneRe: BUG #16216: the result of to_date function with negative year number not same as BC year number
2020-01-17 15:15:15+00Fabien COELHORe: BUG #16216: the result of to_date function with negative year number not same as BC year number
2020-01-17 15:29:52+00Tom LaneRe: BUG #16216: the result of to_date function with negative year number not same as BC year number