Code

RRTimeslice: added a cast to timestamp.
[postrr.git] / src / postrr.sql.in
index 8596cf8e66d3162726ba670535e77e5dfaa9d0a7..ed51ab676f2de477039986a248bcbde81c482bf8 100644 (file)
@@ -100,6 +100,15 @@ CREATE CAST (rrtimeslice AS rrtimeslice)
        WITH FUNCTION RRTimeslice(rrtimeslice, integer, boolean)
        AS IMPLICIT;
 
+CREATE OR REPLACE FUNCTION Tstamp(rrtimeslice)
+       RETURNS timestamp
+       AS 'postrr-@POSTRR_MAJOR_VERSION@.@POSTRR_MINOR_VERSION@', 'rrtimeslice_to_timestamp'
+       LANGUAGE 'C' IMMUTABLE STRICT;
+
+CREATE CAST (rrtimeslice AS timestamp)
+       WITH FUNCTION Tstamp(rrtimeslice);
+       -- EXPLICIT
+
 CREATE OR REPLACE FUNCTION rrtimeslice_seq_eq(rrtimeslice, rrtimeslice)
        RETURNS boolean
        AS 'postrr-@POSTRR_MAJOR_VERSION@.@POSTRR_MINOR_VERSION@', 'rrtimeslice_seq_eq'