Created
June 25, 2016 23:58
-
-
Save tobyhede/2e8e14cdfa978f553568a6042cd5b2c9 to your computer and use it in GitHub Desktop.
Easily generate timeseries data in PostgreSQL
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 TABLE tseries AS | |
SELECT ts, (random()*9999)::int as count from generate_series( | |
'2015-01-01'::timestamptz, | |
'2016-06-01'::timestamptz, | |
'1 sec'::interval | |
) date; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment