Re: Unique UUID value - PostgreSQL 9.2

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Unique UUID value - PostgreSQL 9.2
Date: 2016-03-15 22:01:57
Message-ID: 56E88655.7090404@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/15/2016 2:48 PM, drum(dot)lucas(at)gmail(dot)com wrote:
> It's already working:
>
> INSERT INTO junk.wm_260_billables2 (account_id, code, info)
> SELECT account_id, 'test_' || uuid_generate_v4(), info
> FROM junk.wm_260_billables1;
>
>
> BUT.. I'm getting a very long UUID - Would like some smaller
>
> test_ea8bacbe-fa3c-4072-b511-643a56feb40e
>

that would be a v4 uuid, like you asked for in the above code.

test=# select uuid_generate_v4();
uuid_generate_v4
--------------------------------------
09b24e5b-5116-435e-94b9-f0da4661f594

afaik, all UUID's are 128 bit numbers expressed in hexadecimal in that
format. This is an ISO standard.

--
john r pierce, recycling bits in santa cruz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-03-15 22:16:38 Re: Unique UUID value - PostgreSQL 9.2
Previous Message drum.lucas@gmail.com 2016-03-15 21:48:39 Re: Unique UUID value - PostgreSQL 9.2