-- Create function days_in_year
CREATE OR REPLACE FUNCTION days_in_year(year double precision)
RETURNS integer
LANGUAGE sql
BEGIN ATOMIC
    SELECT EXTRACT(day FROM ((concat('01/01/', (year + (1)::double precision)))::timestamp without time zone - (concat('01/01/', year))::timestamp without time zone)) AS "extract";
END;
