News for hackers. Stuff that matters.
Re:How to create a 1M record table with a single query by jeffbee on Wednesday March 24, 2021 @11:06AM (#26568150)
If you're running PostgreSQL you can also just

  xxd -ps -c 16 -l $bignum < /dev/urandom | (echo '\copy random_data from stdin'; cat) | psql
Depending on how you want your random keys formatted.
Re:How to create a 1M record table with a single query by em500 on Wednesday March 24, 2021 @11:12AM (#26568228)
If you're importing from command line tools, you might as well use the specialized `shuf` tool:

  shuf -i 1-$bignum
or for random numbers with replacement

  shuf -i 1-$bignum -r -n $bignum
These give you a sample of random integers. `shuf` is part of GNU coreutils, so present in most Linux installs (but not on macOS).
Re:How to create a 1M record table with a single query by fouc on Wednesday March 24, 2021 @11:25AM (#26568421)
It's worth installing GNU coreutils on macOs All the command names are prepended with g, so `gshuf`
Re:How to create a 1M record table with a single query by jeffbee on Wednesday March 24, 2021 @11:24AM (#26568400)
Nice yeah that's a good way. Generally the number 1 million is so small I see no reason to do this in any manner other than shell commands.