dblink without running the full query remotely?

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: dblink without running the full query remotely?
Date: 2023-08-25 18:20:23
Message-ID: CAOC+FBWCx3iunwdXYRKmr89O2qXNeOHgSTvv13Cju73LNcvKEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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:

create view myview as;
select * from dblink(
'server',
'select id from sometable')
cols(id bigint);

And then

select * from myview where id = 123;

Where that remote sometable might have a bajillion rows and the local where
would be passed to it otherwise it's days and days for all rows to be
returned and then filtered.

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2023-08-25 21:16:46 Re: dblink without running the full query remotely?
Previous Message Georg H. 2023-08-25 11:24:12 Re: Temporary disabling a replica in a Patroni cluster