From: MichaelDBA <MichaelDBA@sqlexec.com>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: S. Bob <sbob@quadratum-braccas.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Unique cluster / instance identifier?
Date: Mon, 18 Feb 2019 13:07:55 -0500
Message-ID: <5C6AF47B.5030207@sqlexec.com> (raw)
In-Reply-To: <87r2c5htm3.fsf@news-spur.riddles.org.uk>
References: <92d53982-cf1d-ce3f-c541-60a252f85aef@quadratum-braccas.com>
<87r2c5htm3.fsf@news-spur.riddles.org.uk>
ahhh good to know regarding pg12, thanks
> Andrew Gierth <mailto:andrew@tao11.riddles.org.uk>
> Monday, February 18, 2019 1:03 PM
>
> 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.
>
> S. Bob <mailto:sbob@quadratum-braccas.com>
> Monday, February 18, 2019 12:08 PM
> Hi all;
>
>
> Does PostgreSQL store a unique cluster or instance identifier that we
> can access to identify our instances?
>
>
> Thanks in advance
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: MichaelDBA@sqlexec.com, andrew@tao11.riddles.org.uk, sbob@quadratum-braccas.com
Subject: Re: Unique cluster / instance identifier?
In-Reply-To: <5C6AF47B.5030207@sqlexec.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox