Created
February 23, 2017 07:53
-
-
Save omerucel/89dcdbfedef3f4b40489476b5206a975 to your computer and use it in GitHub Desktop.
Generate test data
This file contains hidden or 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
INSERT INTO test_table (service_id, event_type, creation_date) | |
SELECT | |
generate_series(7070001, 7070010) AS service_id, | |
('{clicked,pageview,failed}'::text[])[ceil(random()*3)] AS event_type, | |
timestamp '2016-01-10 20:00:00' + random() * (timestamp '2017-02-21 20:00:00' - timestamp '2016-01-10 10:00:00') AS creation_date | |
FROM generate_series(1, 10000000) AS X; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment