BUG #16216: the result of to_date function with negative year number not same as BC year number

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: szx9231(at)gmail(dot)com
Subject: BUG #16216: the result of to_date function with negative year number not same as BC year number
Date: 2020-01-17 12:42:19
Message-ID: 16216-68da08087f3aeb78@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16216
Logged by: zhongxuan sun
Email address: szx9231(at)gmail(dot)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~

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2020-01-17 12:53:11 Re: REINDEX CONCURRENTLY unexpectedly fails
Previous Message Stefan Sonnenberg-Carstens 2020-01-17 10:42:28 Re: BUG #16215: Restore failes if number of workers in postgresql.conf is lower than on source system