--- /dev/null
+-- Function: adddate(timestamp without time zone, integer)
+
+-- DROP FUNCTION adddate(timestamp without time zone, integer);
+
+CREATE OR REPLACE FUNCTION adddate(ddate timestamp without time zone, dday integer)
+ RETURNS timestamp without time zone AS
+$BODY$BEGIN
+return ddate + cast(dday|| ' days' as interval);
+END;$BODY$
+ LANGUAGE 'plpgsql' STABLE
+ COST 100;
\ No newline at end of file