Fix EXTRACT(ISOYEAR FROM timestamp) for years BC.
Tom Lane <tgl@sss.pgh.pa.us>
Fix EXTRACT(ISOYEAR FROM timestamp) for years BC. The test cases added by commit 26ae3aa80 exposed an old oversight in timestamp[tz]_part: they didn't correct the result of date2isoyear() for BC years, so that we produced an off-by-one answer for such years. Fix that, and back-patch to all supported branches. Discussion: https://postgr.es/m/SG2PR06MB37762CAE45DB0F6CA7001EA9B6550@SG2PR06MB3776.apcprd06.prod.outlook.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/timestamp.c | modified | +7 −0 |
| src/test/regress/expected/timestamp.out | modified | +1 −1 |
| src/test/regress/expected/timestamptz.out | modified | +1 −1 |
Discussion
- Duplicate function call on timestamp2tm 5 messages · 2019-12-12