Skip to content

Instantly share code, notes, and snippets.

@simonthompson99
Last active January 15, 2021 11:35
Show Gist options
  • Select an option

  • Save simonthompson99/e7ee52dd05c0efef7c2accd7222732e8 to your computer and use it in GitHub Desktop.

Select an option

Save simonthompson99/e7ee52dd05c0efef7c2accd7222732e8 to your computer and use it in GitHub Desktop.
[Random data query] Generate random data query #sql #database
-- generates 5000000 rows of random data
select i
,now() - (random() * (interval '100 years'))
,(array['1', '2'])[floor(random() * 2 + 1)]
from pg_catalog.generate_series(100000001, 105000000, 1) s(i)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment