Last active
June 5, 2019 08:23
-
-
Save knoopx/5eb3650e1cdae233b19ac450d170fbb2 to your computer and use it in GitHub Desktop.
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
# generates random dates per row | |
update myjacoti_measurementsession set date_start = (select random_date() where myjacoti_measurementsession.uuid = myjacoti_measurementsession.uuid); |
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
CREATE OR REPLACE FUNCTION random_date() RETURNS timestamptz AS $$ | |
select NOW() - (trunc(random() * 360) * '1 day'::interval); | |
$$ LANGUAGE sql STRICT VOLATILE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment