Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oG6nC-0004au-5F for pgsql-general@arkaria.postgresql.org; Mon, 25 Jul 2022 22:43:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oG6nA-00077e-W2 for pgsql-general@arkaria.postgresql.org; Mon, 25 Jul 2022 22:43:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oG6n9-000740-7P for pgsql-general@lists.postgresql.org; Mon, 25 Jul 2022 22:43:12 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oG6n4-0007C5-KQ for pgsql-general@postgresql.org; Mon, 25 Jul 2022 22:43:10 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E2B9A5C01C4; Mon, 25 Jul 2022 18:43:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 25 Jul 2022 18:43:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1658788983; x= 1658875383; bh=hdp+r3+HDEMA6H+pMkwi8flrsaUk6/A5c5Gk7Y2gJWw=; b=c r/61JE0k5owlc81UoJRMYmz9aSsop5LeQwF4D9sIWjxjU7O8PrsfTYlMLUX70Ubo OJ4eL6VRJGgb9f01Fz2OqwnEyZwKM67mmyo3dKnwsbxTNEYY58tGZtpcegFW0lu0 dpg44ocgvM8Qq0UZMelDvgD/4GvqLhTXTpQYdhESlF5r4PGyJb4/SMFfb9q4eGVj Ub2wiI4qI8Q3KsJRD6RQyOc0cbzgI6Ga01eYvZn83nbAFKHjcTHEFM3847MjAplW dp+h2d63vMIDJf0lSHs4/GJ5qVDdYDR+KOdgl+RERr2XOCQQ8DRByaNjcQiTrbAG QsjPr7GL46aYTwba2bTwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1658788983; x=1658875383; bh=h dp+r3+HDEMA6H+pMkwi8flrsaUk6/A5c5Gk7Y2gJWw=; b=QjT++CB9gvgLipDds fkP+CEV8geFcTxSFErO+BPojErAwmXVhJh+zPT0OkMaid7yBls/KvIkE+CdM47u2 Dg700vz7UM5cBtFF02F8eJH1kmh2uRx7U2jDAdrcPcZZscN+p2ByHhkwTIQRqoPJ pgz3dmg+xI9c8qlTjrbFVBnil6w5E4z675AOSYe/bnWKPBNAJ6aszfkmZTbRJHXG mPVjMOUDzhjSINyC3yT8v/k9RUkE44Z3FdZd6bQ+MlH2foBDB5lYteJkT8sn+lzj B0Y3lSPiXpsC91F/kwbFlbQx8swob4nevCEHLbLzby4XV87tRTVxb/y3bEqqqHaU 1+yeg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddtledguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeelkeegjefhkeetheefudevteehiedvudehkeduleet fedvffeuhedtvdegtdeffeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Jul 2022 18:43:03 -0400 (EDT) Message-ID: <73263e4e-7f78-5540-af05-bae1aaaf2741@aklaver.com> Date: Mon, 25 Jul 2022 15:43:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Streaming Replication, can't select row in backup without specifying collation Content-Language: en-US To: Kelly Burkhart , pgsql-general References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/25/22 15:36, Kelly Burkhart wrote: > I have a primary and backup database running 12.10 and synced with > streaming replication.  I have a simple table that is returning > different results for the same query in the primary vs backup database. > > On the primary DB: > > > select tag::bytea, * from sentinel where tag = > 'quote_merge_locs_mnj_NSX_20220719'; >                                  tag                                  | >                tag                |           event_ts > ----------------------------------------------------------------------+-----------------------------------+------------------------------- >  \x71756f74655f6d657267655f6c6f63735f6d6e6a5f4e53585f3230323230373139 | > quote_merge_locs_mnj_NSX_20220719 | 2022-07-19 20:29:14.114238-05 > (1 row) > > On the backup: > > > select tag::bytea, * from sentinel where tag = > 'quote_merge_locs_mnj_NSX_20220719'; >  tag | tag | event_ts > -----+-----+---------- > (0 rows) > > > select tag::bytea, * from sentinel where tag = > 'quote_merge_locs_mnj_NSX_20220719' collate "C"; >                                  tag                                  | >                tag                |           event_ts > ----------------------------------------------------------------------+-----------------------------------+------------------------------- >  \x71756f74655f6d657267655f6c6f63735f6d6e6a5f4e53585f3230323230373139 | > quote_merge_locs_mnj_NSX_20220719 | 2022-07-19 20:29:14.114238-05 > (1 row) > > Can anyone explain why the backup does not show the row without > specifying a collation? > > The primary is running CentOS 7.4, the backup is running CentOS 8.  The > backup was created from a basebackup.  The postgres binaries were built > on the OS on which they're running.  Neither were built with ICU (which > I didn't know existed until tracking this down...).  Both databases show > LC_COLLATE=en_US.UTF-8. > > The query "select * from pg_collation where collname like '%en_US%';" > returns identical results for both databases. > > I'm concerned that somehow I've created a backup that is not compatible > in some mysterious way with my primary. > > Can anyone provide any insight on what is going on? See: https://wiki.postgresql.org/wiki/Locale_data_changes In particular: https://wiki.postgresql.org/wiki/Locale_data_changes#RHEL.2FCentOS > > Thank you, > > -Kelly > > -- Adrian Klaver adrian.klaver@aklaver.com