Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOeyS-007sG1-FK for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 15:31:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tOeyR-00CloN-Jc for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 15:31:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOeyR-00Clnz-8g for pgsql-general@lists.postgresql.org; Fri, 20 Dec 2024 15:31:30 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOeyO-000ZSK-Gy for pgsql-general@lists.postgresql.org; Fri, 20 Dec 2024 15:31:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4BKFVQOF675020; Fri, 20 Dec 2024 10:31:26 -0500 From: Tom Lane To: Ekaterina Amez Gonzalez cc: pgsql-general@lists.postgresql.org Subject: Re: Streaming replication problem with collation In-reply-to: References: Comments: In-reply-to Ekaterina Amez Gonzalez message dated "Fri, 20 Dec 2024 11:06:29 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <675018.1734708686.1@sss.pgh.pa.us> Date: Fri, 20 Dec 2024 10:31:26 -0500 Message-ID: <675019.1734708686@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ekaterina Amez Gonzalez writes: > I tried what was suggested: reindexing and running "refresh collation" > alter after that and everything seems to work ok so this looks like an easy > wat to migrate from one server to another. Plus I feel more comfortable > using streaming replication than logical replication, and also I find it > more useful when you need to replicate the whole cluster. > So my question is: is there anything I'm missing here, some kind of problem > that could hit my face after moving to the new server? That will almost certainly blow up in your face. Physical replication assumes that the source and replica databases are to be kept bitwise identical. What you've described is already not bitwise identical because (a) the collation versions recorded for the indexes are different and (b) reindexing would have rebuilt the indexes, so that there's no reason to expect that all the index entries are in the same physical spots as before. Moreover, the entire point of all this worry about collation versions is that (c) the logical ordering of the indexes might now be different. So enabling physical replication at this point would surely make a mess of the replica's indexes. You'll have to use logical replication for this. regards, tom lane