Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created December 19, 2017 20:15
Show Gist options
  • Select an option

  • Save ddrscott/52f0c5131304e8a64c24575c71f2a2ce to your computer and use it in GitHub Desktop.

Select an option

Save ddrscott/52f0c5131304e8a64c24575c71f2a2ce to your computer and use it in GitHub Desktop.
CREATE TABLE __test AS
SELECT *,
CURRENT_TIMESTAMP
FROM generate_series(0, 100);
SELECT * FROM __test;
UPDATE __test SET now = COALESCE(NULLIF('' || pg_sleep(0.01), '')::timestamp, clock_timestamp());
SELECT * FROM __test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment