Skip to content

Instantly share code, notes, and snippets.

@jonpemby
Created March 5, 2018 15:33
Show Gist options
  • Save jonpemby/9d0e2cdd37b44b515b13be7fe3b00697 to your computer and use it in GitHub Desktop.
Save jonpemby/9d0e2cdd37b44b515b13be7fe3b00697 to your computer and use it in GitHub Desktop.
PostgreSQL random string from list
select (array['hello', 'world'])[trunc(1 + random() * @len)];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment