PostgreSQL: How to generate a Random Token String?

In this post, I am providing different scripts to generate a random string in PostgreSQL.

Sometimes, we also require to generate a random token and any other random code in the Database System.

The PostgreSQL Provides a random() function to generate a random string with all the possible different numbers, character and symbol.
We can also use random() function with cryptography or encryption function to generate a fixed length binary string.

Generate a random string using MD5():

Generate a Capital Latter random string, size of 15.

Generate a Small Latter random string, size of 15.

Generate a Numerical random string, size of 15.

Generate a random string with all combinations, size of 15.


Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz