Skip to content

Instantly share code, notes, and snippets.

@rodo
Last active February 19, 2021 09:43
Show Gist options
  • Select an option

  • Save rodo/ffafe81b7dd4b41625278a740bf4ff13 to your computer and use it in GitHub Desktop.

Select an option

Save rodo/ffafe81b7dd4b41625278a740bf4ff13 to your computer and use it in GitHub Desktop.
PostgreSQL random date
[local]:5412 rodo@rodo=# SELECT get_random_date('1 week'), generate_series(1,5);
get_random_date | generate_series
-----------------+-----------------
2021-02-22 | 1
2021-02-18 | 2
2021-02-17 | 3
2021-02-22 | 4
2021-02-17 | 5
(5 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment