Re: looking for a globally unique row ID

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Rafal Pietrak <rafal(at)ztk-rp(dot)eu>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: looking for a globally unique row ID
Date: 2017-09-14 07:57:59
Message-ID: CAB7nPqT4ZspCTM+6iaAixcyMEuyGv7cza-jnaPGA2vkJJOH-hg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 14, 2017 at 4:45 PM, Rafal Pietrak <rafal(at)ztk-rp(dot)eu> wrote:
> Can anybody help me find a way to implement an ID which:
>
> 1. guarantees being unique across multiple tables.
>
> 2. guarantees its uniqueness not only during INSERT, but also during the
> lifetime of the database/application (e.i. during future UPDATES).
>
> 3. guarantees persistence of value across database backup/restore/upgrade.
> [...]
> I'd appreciate any hints, as I'm bitting my head against this problem
> for a long time, now.

UUID would give you some room for requirement 1. 2 and 3 can be found
with the usage of a serial column.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Millman 2017-09-14 08:14:14 a JOIN to a VIEW seems slow
Previous Message John R Pierce 2017-09-14 07:57:09 Re: looking for a globally unique row ID