On 11/19/18 2:08 PM, Uday Bhaskar V wrote:
I tried below function as which can be used as default to column. But every time we need to created 2 sequences, 1st one takes care of the first 8 bytes and 2nd takes care of the 2nd part of the UUID. I have not tested index and space utilization. I have to examine this. This might not be completely unique in the nature. but still trying for the best.
I got a bit bored a couple of days ago, so I wrote an extension generating UUIDs based on either a sequence or timestamp. See
https://blog.2ndquadrant.com/sequential-uuid-generators/ for an explanation and some simple test results. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services