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 1tq6Qd-00H2le-HA for pgsql-general@arkaria.postgresql.org; Thu, 06 Mar 2025 08:18:03 +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 1tq6Qb-002s17-Vx for pgsql-general@arkaria.postgresql.org; Thu, 06 Mar 2025 08:18:02 +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 1tq6Qb-002s0y-LY for pgsql-general@lists.postgresql.org; Thu, 06 Mar 2025 08:18:01 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tq6QZ-001GJX-0D for pgsql-general@lists.postgresql.org; Thu, 06 Mar 2025 08:18:00 +0000 Message-ID: <001b7951-c692-44e3-9b9c-93ecbc509d6b@cloud.gatewaynet.com> Date: Thu, 6 Mar 2025 10:17:55 +0200 MIME-Version: 1.0 Subject: Re: Quesion about querying distributed databases To: pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Achilleas Mantzios - cloud In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/5/25 11:55, Laurenz Albe wrote: > On Wed, 2025-03-05 at 12:57 +0330, me nefcanto wrote: >> Right now this data is in MariaDB, on separate databases (schema) but on one >> server. The solution in this situation is to have a cross-database query. >> (this is the status quo of our application) >> >> Now our team has decided to migrate to Postgres. However, we realized that >> Postgres does not support cross-database queries. And if we want to do so, >> we should use FDW. So, we thought we might as well put databases on separate >> servers for scalability if we have to write more code. That's the reason >> behind this question. > In MySQL, the terms "database" and "schema" are used for the same thing. > Not so in PostgreSQL. I think you should migrate the data into different > schemas in a single database, pretty much like you had it in MySQL. > Then you don't need a foreign data wrapper, and I bet the query can > perform as well as it did on MySQL. Same thing in MS SQL, as of version 2017 or so. > > Yours, > Laurenz Albe > > >