Re: Unique cluster / instance identifier?

From: "S(dot) Bob" <sbob(at)quadratum-braccas(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Unique cluster / instance identifier?
Date: 2019-02-18 18:07:29
Message-ID: a1476f35-afe1-24fe-e86c-4e20fae0f4f5@quadratum-braccas.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Perfect!  Thanks

On 2/18/19 11:03 AM, Andrew Gierth wrote:
>>>>>> "S" == S Bob <sbob(at)quadratum-braccas(dot)com> writes:
> S> Hi all;
>
> S> Does PostgreSQL store a unique cluster or instance identifier that
> S> we can access to identify our instances?
>
> Yes. But it's not easy to get at: it's the "Database system identifier"
> shown in the output of pg_controldata. (pg12+ will have a function to
> get it from SQL, but released versions don't.)
>
> e.g.
>
> Database system identifier: 6659016342798875639
>
> The number is mostly generated from the time the instance was created,
> with some bits modified. So for example:
>
> $ perl -le 'print scalar gmtime +(shift >> 32)' 6659016342798875639
> Sun Feb 17 17:04:21 2019
>
> PG uses this internally to make sure that replication never tries to
> apply WAL records generated on one system to a different system.
> Physical replication secondary systems share the primary's system
> identifier since they always originate as a copy (via base backup) of
> the primary.
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message MichaelDBA 2019-02-18 18:07:55 Re: Unique cluster / instance identifier?
Previous Message Andrew Gierth 2019-02-18 18:03:34 Re: Unique cluster / instance identifier?