Skip to content

Instantly share code, notes, and snippets.

@kaatinga
Created May 23, 2022 14:18
Show Gist options
  • Save kaatinga/3d8ceee3daeb1ff9a563239f5f9dabcd to your computer and use it in GitHub Desktop.
Save kaatinga/3d8ceee3daeb1ff9a563239f5f9dabcd to your computer and use it in GitHub Desktop.
fast way to add a lot of data to a database
insert into attribute_allowed_lists (attributeid, allowedvalue) select 2, md5(generate_series::text) from generate_series(1, 100000);

or

insert into test3 (id, name) select generate_series, gen_random_uuid() from generate_series(1, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment