Re: UUID type question

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
Cc: postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: UUID type question
Date: 2022-02-18 14:24:40
Message-ID: CAFCRh-9Ud7q+y2+Oh9v5U4tGzUyca096=7e_s8nwmhR_8yTeDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 18, 2022 at 3:06 PM Laura Smith
<n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch> wrote:
> Is there anything inherently "special" about the UUID type ? i.e. if I store a UUID in a text is it "worse" ?

uuid is stored as 16 binary bytes.
Store it as text, and that's 36 chars (assuming UTF-8, double-that in
UTF-16, if that's possible in PG).
Or encode it as base-62 instead of hexa (base-16, with dashes), to use
only 22 chars as text (in UTF-8 or ASCII)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marco DE BOOIJ 2022-02-18 14:27:34 Re: pg_upgrade from Postgresql-12 to Postgresql-13 fails with "Creating dump of database schemas postgres *failure*"
Previous Message Laura Smith 2022-02-18 14:06:28 UUID type question