Skip to content

Instantly share code, notes, and snippets.

@rponte
Created December 7, 2022 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rponte/6b8f55209e29bd7b325047addbdec30a to your computer and use it in GitHub Desktop.
Save rponte/6b8f55209e29bd7b325047addbdec30a to your computer and use it in GitHub Desktop.
PostgreSQL: generating sample data
INSERT INTO proposal (
id, address, created_at, "document", email, "name", salary, status, updated_at
)
select
md5(random()::text || clock_timestamp()::text)::uuid as id
,'Rua das Tabajaras, ' || floor(random() * 9999)::int as address
,localtimestamp as created_at
,left(md5(random()::text), 16) as "document"
,left(md5(random()::text), 6) || '@zup.com.br' as email
,'Customer ' || left(md5(random()::text), 22) as "name"
,trunc((random() * 99999)::numeric, 2) as salary
,'ELIGIBLE' as status
,localtimestamp as updated_at
from generate_series(1, 10000) s(i)
@rponte
Copy link
Author

rponte commented Dec 7, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment