Skip to content

Instantly share code, notes, and snippets.

@edib
Created December 22, 2016 19:11
Show Gist options
  • Select an option

  • Save edib/69b5dbea2159d6516e95362bb1d002b5 to your computer and use it in GitHub Desktop.

Select an option

Save edib/69b5dbea2159d6516e95362bb1d002b5 to your computer and use it in GitHub Desktop.
CREATE OR REPLACE FUNCTION insert_date(INTEGER,INTEGER,DATE) RETURNS VOID AS $$
DECLARE
mystart alias for $1;
myend alias for $2;
mydate alias for $3;
BEGIN
FOR i IN mystart..myend LOOP
INSERT INTO impressions_by_day values(i,mydate,round(random()*10000));
END LOOP;
END;
$$ LANGUAGE 'plpgsql' STRICT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment