This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Convenience Functions | |
CREATE OR REPLACE FUNCTION to_epoch(IN timestamptz, OUT epoch float8) AS | |
$$ SELECT extract(epoch from $1) $$ LANGUAGE SQL; | |
CREATE OR REPLACE FUNCTION ts_at_tod(IN timestamptz, IN timetz, OUT timestamptz) AS | |
$$ SELECT date($1) + $2 $$ LANGUAGE SQL; | |
-- Get list of target time between start and end | |
CREATE OR REPLACE FUNCTION times_between(IN range_start timestamptz, IN range_end timestamptz, IN t timetz) | |
RETURNS setof timestamptz AS $$ | |
SELECT * FROM |