timestamp out of range while casting return value to function'sreturn type - Mailing list pgsql-general

From Thiemo Kellner
Subject timestamp out of range while casting return value to function'sreturn type
Date
Msg-id 20190824005707.Horde.lG5m5T6XNruzVvf0LZ6QFRV@webmail.gelassene-pferde.biz
Whole thread Raw
Responses Re: timestamp out of range while casting return value to function's return type
Re: timestamp out of range while casting return value to function'sreturn type
List pgsql-general
Hi all

I created a function that ought to return a timestamptz (another  
likewise timestamp) but calling it, I get mentionied error. What do I  
miss? I tried to return a timestamp of the year 2000 to no avail.

Call: select utils.get_max_timestamptz();
--

Function
--
create or replace function GET_MAX_TIMESTAMPTZ()
   returns timestamptz
   language plpgsql
   immutable
   -- Include the hosting schema into search_path so that dblink
   -- can find the pglogger objects. There is no need to access
   -- objects in other schematas not covered with public.
   as
$body$
     begin
         -- highest timestamps on 64bit lubuntu vanilla PostgreSQL 11.3
         return '294277-01-01 00:59:59.999999'::timestamptz;
     end;
$body$;

Kind regards

Thiemo

-- 
S/MIME Public Key: https://oc.gelassene-pferde.biz/index.php/s/eJuAUFONag6ofnH
Signal (Safer than WhatsApp): +49 1578 7723737
Handys: +41 78 947 36 21 | +49 1578 772 37 37
Tox-Id:  
B7282A9E31D944DDAD1ECC5B33C36AAE80B32D119AB7391D602C937A65E8CA0625C495C5322B




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: slow queries on system tables
Next
From: Tom Lane
Date:
Subject: Re: timestamp out of range while casting return value to function's return type