Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvnKN-00089e-IJ for pgsql-admin@arkaria.postgresql.org; Mon, 18 Feb 2019 18:07:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvnKM-00069E-9B for pgsql-admin@arkaria.postgresql.org; Mon, 18 Feb 2019 18:07:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvnKK-00064V-5t for pgsql-admin@lists.postgresql.org; Mon, 18 Feb 2019 18:07:38 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvnKG-0004jL-6Y for pgsql-admin@postgresql.org; Mon, 18 Feb 2019 18:07:34 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E60E42144B; Mon, 18 Feb 2019 13:07:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 18 Feb 2019 13:07:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=subject:to:cc:references:from :message-id:date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=fm1; bh=8fzB0hxf/Kn/dHyoTfsLOK5xJm d0wYkf7gDbgZS8bAw=; b=aWbNU5389eAyF0/+zrAzhHN8fZo8xSJ7TOK2WyhCg+ T13Vlk5Sj/BIc0CNEyzgQ7xH1F4GDTf6FiGdavZqH5I/B6uvDkDXhnF35Wg+9lSU MkKDxWkGElH+1kIYrqZiG4qtqGxvOt8lQHh4SkJOuO2w0SUEkQsPUq9FsCU7583D 71WBXVXfIirBH/HhZWo1VF67M9QmpZ8hwcun6rWhUQsjiieJXbOn78JaZUrFMnVg kwtLlVOBNYYuhmbK/NaUgGAMvqvMO8FAXk2kkFoqMkrD5K5F+AdKXSOTqd2D3v0b dBQuh+z/LPOmr/dZC33jbD6+GOIKzg6OGEfH1eowafMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=8fzB0hxf/Kn/dHyoTfsLOK5xJmd0wYkf7gDbgZS8b Aw=; b=pyK/duKXywAm/CbZ+kVdaJvsGapRUd8vUc8rfi81LOdQXVB5B5lns23fZ yNw3WzMmToKpqcpI9P8NY57oQVwM/I6REYtFnbHsjYByH15PJczudXd8uyWM7jS1 csX0HrCPbnvs804eMq4ysEKmY70FZuClTPFb7WLqa1Kkg+GLAyyaNFqV2qONP9mW w5cLH4oxJpG0COa16fmp2dX+QQYby9aEnlWR45aETySUfgPBNhth1/S9TSa4Ubit seEgPhe7iBXNv9vYlzyQMNx8w9Rt5iSxXwTRjagNUUdsRnZ3w+6FoKnlVA4xRJRl tX2YIEF4Il6WVEGLPVovbEZIdSXGw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtddugdejkeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomhepfdfurdcu uehosgdfuceoshgsohgssehquhgrughrrghtuhhmqdgsrhgrtggtrghsrdgtohhmqeenuc fkphephedtrddvgeefrdduhedtrdekudenucfrrghrrghmpehmrghilhhfrhhomhepshgs ohgssehquhgrughrrghtuhhmqdgsrhgrtggtrghsrdgtohhmnecuvehluhhsthgvrhfuih iivgeptd X-ME-Proxy: Received: from [10.16.0.189] (50-243-150-81-static.hfc.comcastbusiness.net [50.243.150.81]) by mail.messagingengine.com (Postfix) with ESMTPA id 114361030F; Mon, 18 Feb 2019 13:07:29 -0500 (EST) Subject: Re: Unique cluster / instance identifier? To: Andrew Gierth Cc: pgsql-admin References: <92d53982-cf1d-ce3f-c541-60a252f85aef@quadratum-braccas.com> <87r2c5htm3.fsf@news-spur.riddles.org.uk> From: "S. Bob" Message-ID: Date: Mon, 18 Feb 2019 11:07:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <87r2c5htm3.fsf@news-spur.riddles.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Perfect!  Thanks On 2/18/19 11:03 AM, Andrew Gierth wrote: >>>>>> "S" == S Bob 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. >