I need to put some random values into database, but I don't want to end up with completely randomized text (like 7hfg43d3). Instead I would like to randomly pick one of values supplied by myself.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Nice idea. I suggest two minor simplifications:
However, I have never seen that happen. Run a couple of million tests:
To be perfectly safe, though, you can use Postgres custom array subscripts and still avoid the extra addition:
I came up with idea to use Arrays to accomplish this: