Re: Using make_timestamp() to create a BC value

From: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
To: Tom Lane PostgreSQL <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Using make_timestamp() to create a BC value
Date: 2021-10-06 22:46:54
Message-ID: 8B68EF39-3BF5-4426-9D12-30EED5AC1F69@yugabyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
>
>> Bryn wrote:
>>
>> But this invocation makes the assertion fail:
>> call assert_make_ts_from_extracted_fields_from_ts_ok('0001-01-01 00:00:00 BC');
>> The 22008 error is reported thus:
>> date field value out of range: -1-01-01
>
> As of v14, make_timestamp[tz] will accept negative year values as meaning BC. Before that, they threw errors.

Ah… that's excellent news. Thanks for the lightening fast response, Tom. Thanks, too, to Adrian who passed on similar news, and this link:

www.postgresql.org/docs/current/release-14.html#id-1.11.6.5.3

I did my test using PostgreSQL 13.4. Forgive me for not mentioning this.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2021-10-07 06:17:16 Misplaced double quotes in error message
Previous Message Tom Lane 2021-10-06 22:28:50 Re: Using make_timestamp() to create a BC value