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 1qZeAs-006I0k-4b for pgsql-admin@arkaria.postgresql.org; Fri, 25 Aug 2023 21:16:58 +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 1qZeAq-0063fK-NK for pgsql-admin@arkaria.postgresql.org; Fri, 25 Aug 2023 21:16:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZeAq-0063f4-BZ for pgsql-admin@lists.postgresql.org; Fri, 25 Aug 2023 21:16:56 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZeAj-0012h9-0f for pgsql-admin@postgresql.org; Fri, 25 Aug 2023 21:16:55 +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 37PLGkOA4193748; Fri, 25 Aug 2023 17:16:46 -0400 From: Tom Lane To: Wells Oliver cc: pgsql-admin Subject: Re: dblink without running the full query remotely? In-reply-to: References: Comments: In-reply-to Wells Oliver message dated "Fri, 25 Aug 2023 11:20:23 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4193746.1692998206.1@sss.pgh.pa.us> Date: Fri, 25 Aug 2023 17:16:46 -0400 Message-ID: <4193747.1692998206@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Wells Oliver writes: > Per the documentation -- *dblink fetches the entire remote query result > before returning any of it to the local system* -- I am guessing the answer > is no, but I wondered if there was some way to do something like this: > ... > Where that remote sometable might have a bajillion rows and the local where > would be passed to it No, and it's unlikely anyone would ever put effort into making dblink do that, because the newer foreign table (FDW) code *does* handle that sort of thing. dblink still has its uses, but it's pretty much at a dead end developmentally. Take a look at postgres_fdw. regards, tom lane