Created
March 7, 2017 14:41
-
-
Save andboson/49c8d1400273a470a436288c9ecf068b to your computer and use it in GitHub Desktop.
insert record with random field
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 cups(reg_id, code, is_enabled, created_at, updated_at ) | |
select | |
1 as reg_id, | |
UPPER(substr(md5(''||now()::text||random()::text), 1,8)) as code, | |
true as is_enabled, | |
to_date(now()::text, | |
'YYYY-MM-DD HH24:MI:SS') as created_at, | |
to_date(now()::text, 'YYYY-MM-DD HH24:MI:SS') as updated_at | |
from generate_series(1,4000000) on conflict DO NOTHING; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment