Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1KZr-0003YZ-PC for pgsql-general@arkaria.postgresql.org; Sat, 24 Aug 2019 01:10:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i1KZq-0001oL-5C for pgsql-general@arkaria.postgresql.org; Sat, 24 Aug 2019 01:10:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1KZp-0001gl-Lp for pgsql-general@lists.postgresql.org; Sat, 24 Aug 2019 01:10:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i1KZm-0005Wt-JF for pgsql-general@lists.postgresql.org; Sat, 24 Aug 2019 01:10:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7O1AYvP027503; Fri, 23 Aug 2019 21:10:34 -0400 From: Tom Lane To: Thiemo Kellner cc: PostgreSQL General Subject: Re: timestamp out of range while casting return value to function's return type In-reply-to: <20190824005707.Horde.lG5m5T6XNruzVvf0LZ6QFRV@webmail.gelassene-pferde.biz> References: <20190824005707.Horde.lG5m5T6XNruzVvf0LZ6QFRV@webmail.gelassene-pferde.biz> Comments: In-reply-to Thiemo Kellner message dated "Sat, 24 Aug 2019 00:57:07 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27501.1566609034.1@sss.pgh.pa.us> Date: Fri, 23 Aug 2019 21:10:34 -0400 Message-ID: <27502.1566609034@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thiemo Kellner 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