Is it safe to use the max function in order to get the next value of a field like it is being done here?
Custom auto-increment field in postgresql (Invoice/Order No.)
I ask this because I need to generate something similar but will the max function returns always a different value for concurrent users? I undertand that a trigger is being used, but again, I dont understand how a max function may be safe here. If not, what should be used?
thank you!