BUG #16216: the result of to_date function with negative year number not same as BC year number - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16216: the result of to_date function with negative year number not same as BC year number
Date
Msg-id 16216-68da08087f3aeb78@postgresql.org
Whole thread Raw
Responses Re: BUG #16216: the result of to_date function with negative yearnumber not same as BC year number  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16216
Logged by:          zhongxuan sun
Email address:      szx9231@gmail.com
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~


pgsql-bugs by date:

Previous
From: Stefan Sonnenberg-Carstens
Date:
Subject: Re: BUG #16215: Restore failes if number of workers inpostgresql.conf is lower than on source system
Next
From: Heikki Linnakangas
Date:
Subject: Re: REINDEX CONCURRENTLY unexpectedly fails