Re: timestamp out of range while casting return value to function's return type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: timestamp out of range while casting return value to function's return type
Date: 2019-08-24 01:10:34
Message-ID: 27502.1566609034@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz> writes:
> I created a function that ought to return a timestamptz (another
> likewise timestamp) but calling it, I get mentionied error. What do I
> miss?

Whether that:

> return '294277-01-01 00:59:59.999999'::timestamptz;

is in range or not depends on your timezone setting. It would
be considered in-range in UTC+1 or further east (so that the date
wraps back to 294276AD); in or west of Greenwich, not so much.

> I tried to return a timestamp of the year 2000 to no avail.

Hardly ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thiemo Kellner 2019-08-24 06:53:08 Re: timestamp out of range while casting return value to function's return type
Previous Message Thiemo Kellner 2019-08-24 00:57:07 timestamp out of range while casting return value to function's return type