I'm making a FDW (Foreign Data Wrapper) in PostgreSQL for myself using C.
And in the test environment below,
myFDW receives the query with/without LIMIT clause case by case.
Test environment:
psql → PC1(Postgresql + postgres_fdw) → PC2(Postgresql + myFDW) → tableA@myUniqueDB
tableA:
tsastimestampdata1asinteger
Such as when I type the following in psql:
select ts
from tableA
where (ts > '2022-01-01')
and (ts < '2022-12-31')
order by ts desc
limit 10;
myFDW receives
select ts
from tableA
where (ts > '2022-01-01')
and (ts < '2022-12-31')
limit 10;
and when I type the following in psql:
select ts,
data1
from tableA
where (ts > '2022-01-01')
and (ts < '2022-12-31')
order by ts desc
limit 10;
myFDW receives
select ts
from tableA
where (ts > '2022-01-01')
and (ts < '2022-12-31');