Creating a random_username function with SQL Editor
Hey there, sorry this might be a little basic of a question but I'm really new to Postgres and need some help.
I'm in the process of creating a new random_username function that will return a username formatted like so:
As far as creating this function I'm creating a new SQL snippet that I have structured as so:
From here, I can't find much on how to future construct this function. Some docs I'm using are as follows:
https://www.techonthenet.com/postgresql/functions/random.php
I think the random() function would be perfect for this. How can I concat "user" + random numbers together in my function?
Again, I apologize this is probably super basic. I'm just so new to this that it looks harder than it seems.
I'm in the process of creating a new random_username function that will return a username formatted like so:
user1234567890.As far as creating this function I'm creating a new SQL snippet that I have structured as so:
From here, I can't find much on how to future construct this function. Some docs I'm using are as follows:
https://www.techonthenet.com/postgresql/functions/random.php
I think the random() function would be perfect for this. How can I concat "user" + random numbers together in my function?
Again, I apologize this is probably super basic. I'm just so new to this that it looks harder than it seems.
This PostgreSQL tutorial explains how to use the PostgreSQL random function with syntax and examples. The PostgreSQL random function can be used to return a random number or a random number within a range.