Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t77614psql -h localhost -U postgresBuilt from patchset v3 (message #3), August 17, 2026 at 10:01 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t77614_3 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t77614_3 && git checkout t77614_3Patchset v3 (message #3) is on t77614_3
Hi,
I was reading
https://www.postgresql.org/docs/current/postgres-fdw.html#POSTGRES-FDW-OPTIONS-REMOTE-EXECUTION
and
found that it mentions that Immutable Functions and Operators can be pushed
down using `extensions` option for foreign server.
But it does not mention about TYPE. In the shippable.c
<https://doxygen.postgresql.org/shippable_8c_source.html>/lookup_shippable()
function, I found that type is also pushed down.
[image: image.png]
Does this require updating the docs? Can I raise a PR to do so? Thank you!
:)
--
Regards
Rajan Pandey
Attachments:
image.pngimage/png; name=image.pngDownload+3-0
On Tue, 2024-04-09 at 15:49 +0530, Rajan Pandey wrote:
I was reading https://www.postgresql.org/docs/current/postgres-fdw.html#POSTGRES-FDW-OPTIONS-REMOTE-EXECUTION
and found that it mentions that Immutable Functions and Operators can
be pushed down using `extensions` option for foreign server.But it does not mention about TYPE. In the shippable.c/lookup_shippable()
function, I found that type is also pushed down.
The comment only says that data types may be shippable, but not that
they are actually shipped. Can you think of a case where a data type
would be shipped to a foreign server? I wrote a foreign data wrapper,
and I cannot think of such a case.
Perhaps the function comment should be adjusted by removing the parenthesis
or changing it to "(operator/function/...)".
Does this require updating the docs? Can I raise a PR to do so? Thank you! :)
You would send a patch against the "master" branch to the pgsql-docs list for that.
Yours,
Laurenz Albe
Hi team 😃.
In the
https://www.postgresql.org/docs/current/postgres-fdw.html#POSTGRES-FDW-OPTIONS-REMOTE-EXECUTION
doc, it
mentions that Immutable Functions and Hi can be pushed down using
`extensions` option for foreign server.
But it does not mention TYPE. In the shippable.c
<https://doxygen.postgresql.org/shippable_8c_source.html>/lookup_shippable()
function, I found a comment that indicates that type is also pushed down.
Hece, I have removed TYPE from the comments, assuming that it does not make
sense to push down a data type, and only functions and operations can be
pushed down. Please let me know if my assumption is incorrect. 🙂
I have added my patch file with the mail. Thanks!
On Tue, Apr 9, 2024 at 4:06 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:
On Tue, 2024-04-09 at 15:49 +0530, Rajan Pandey wrote:
I was reading
https://www.postgresql.org/docs/current/postgres-fdw.html#POSTGRES-FDW-OPTIONS-REMOTE-EXECUTION
and found that it mentions that Immutable Functions and Operators can
be pushed down using `extensions` option for foreign server.But it does not mention about TYPE. In the shippable.c/lookup_shippable()
function, I found that type is also pushed down.The comment only says that data types may be shippable, but not that
they are actually shipped. Can you think of a case where a data type
would be shipped to a foreign server? I wrote a foreign data wrapper,
and I cannot think of such a case.Perhaps the function comment should be adjusted by removing the parenthesis
or changing it to "(operator/function/...)".Does this require updating the docs? Can I raise a PR to do so? Thank
you! :)
You would send a patch against the "master" branch to the pgsql-docs list
for that.Yours,
Laurenz Albe
--
Regards
Rajan Pandey
Hi, please ignore my last email about the patch. :/
I have determined that pushdown of custom data types through fdw in fact
does make sense.
Consider this query:
SELECT * FROM customers WHERE <user_defined_type_col>
<user_defined_operator> <user_defined_function>;
To push down the WHERE clause to the foreign servers, both local and
foreign server must have the user_defined database objects (else the query
won't work on the foreign servers).
For built-in types, operators, functions, Postgres knows that pushdown is
safe as the foreign servers the db objects. But for the user_defined db
objects, postgres won't know. Hence, user_defined_type_col needs to be
pushed down explicitly.
On Tue, Apr 9, 2024 at 8:06 PM Rajan Pandey <rajanpandey2508@gmail.com>
wrote:
Hi team 😃.
In the
https://www.postgresql.org/docs/current/postgres-fdw.html#POSTGRES-FDW-OPTIONS-REMOTE-EXECUTION doc, it
mentions that Immutable Functions and Hi can be pushed down using
`extensions` option for foreign server.But it does not mention TYPE. In the shippable.c
<https://doxygen.postgresql.org/shippable_8c_source.html>/lookup_shippable()
function, I found a comment that indicates that type is also pushed down.
Hece, I have removed TYPE from the comments, assuming that it does not make
sense to push down a data type, and only functions and operations can be
pushed down. Please let me know if my assumption is incorrect. 🙂I have added my patch file with the mail. Thanks!
On Tue, Apr 9, 2024 at 4:06 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:On Tue, 2024-04-09 at 15:49 +0530, Rajan Pandey wrote:
I was reading
https://www.postgresql.org/docs/current/postgres-fdw.html#POSTGRES-FDW-OPTIONS-REMOTE-EXECUTION
and found that it mentions that Immutable Functions and Operators can
be pushed down using `extensions` option for foreign server.But it does not mention about TYPE. In
the shippable.c/lookup_shippable()
function, I found that type is also pushed down.
The comment only says that data types may be shippable, but not that
they are actually shipped. Can you think of a case where a data type
would be shipped to a foreign server? I wrote a foreign data wrapper,
and I cannot think of such a case.Perhaps the function comment should be adjusted by removing the
parenthesis
or changing it to "(operator/function/...)".Does this require updating the docs? Can I raise a PR to do so? Thank
you! :)
You would send a patch against the "master" branch to the pgsql-docs list
for that.Yours,
Laurenz Albe--
Regards
Rajan Pandey
--
Regards
Rajan Pandey