pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres_FDW doc doesn't specify TYPE support in Remote Execution Options
6+ messages / 3 participants
[nested] [flat]
* Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
@ 2024-04-03 10:57 Rajan Pandey <rajanpandey2508@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Rajan Pandey @ 2024-04-03 10:57 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org
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/png] image.png (92.0K, ../../CAPr50M=Dt3A4djHoou2cQVd=eV1dj=KdnA78nyci8v0i4jLkdA@mail.gmail.com/3-image.png)
download | view image
^ permalink raw reply [nested|flat] 6+ messages in thread
* Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
@ 2024-04-09 10:19 Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-09 10:36 ` Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 6+ messages in thread
From: Rajan Pandey @ 2024-04-09 10:19 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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/png] image.png (92.0K, ../../CAPr50Mn8YZxMRNcbF25r2b4tf+sPBj39T6CQyq04-UD8OfPDQA@mail.gmail.com/3-image.png)
download | view image
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
2024-04-09 10:19 Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
@ 2024-04-09 10:36 ` Laurenz Albe <laurenz.albe@cybertec.at>
2024-04-09 14:36 ` Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Laurenz Albe @ 2024-04-09 10:36 UTC (permalink / raw)
To: Rajan Pandey <rajanpandey2508@gmail.com>; pgsql-general@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
2024-04-09 10:19 Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-09 10:36 ` Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Laurenz Albe <laurenz.albe@cybertec.at>
@ 2024-04-09 14:36 ` Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-10 10:24 ` Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Rajan Pandey @ 2024-04-09 14:36 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-docs@lists.postgresql.org; +Cc: pgsql-general@lists.postgresql.org
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
Attachments:
[application/octet-stream] update_lookup_shippable_comments.patch (503B, ../../CAPr50MmFF3aBT-=KauNR9KwX_bkXpCqgj9RKxv5WVVvTKxLzpw@mail.gmail.com/3-update_lookup_shippable_comments.patch)
download | inline diff:
diff --git a/contrib/postgres_fdw/shippable.c b/contrib/postgres_fdw/shippable.c
index ad91660696..c8696c4ba5 100644
--- a/contrib/postgres_fdw/shippable.c
+++ b/contrib/postgres_fdw/shippable.c
@@ -105,7 +105,7 @@ InitializeShippableCache(void)
}
/*
- * Returns true if given object (operator/function/type) is shippable
+ * Returns true if a given function/operator is shippable
* according to the server options.
*
* Right now "shippability" is exclusively a function of whether the object
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
2024-04-09 10:19 Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-09 10:36 ` Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Laurenz Albe <laurenz.albe@cybertec.at>
2024-04-09 14:36 ` Re: Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
@ 2024-04-10 10:24 ` Rajan Pandey <rajanpandey2508@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Rajan Pandey @ 2024-04-10 10:24 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-docs@lists.postgresql.org; +Cc: pgsql-general@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options
@ 2024-04-10 10:24 PG Doc comments form <noreply@postgresql.org>
0 siblings, 0 replies; 6+ messages in thread
From: PG Doc comments form @ 2024-04-10 10:24 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: rajanpandey2508@gmail.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/16/postgres-fdw.html
Description:
Hi,
The
https://www.postgresql.org/docs/current/postgres-fdw.html#POSTGRES-FDW-OPTIONS-REMOTE-EXECUTION
section mentions for `extensions` configuration option:
> Functions and operators that are immutable and belong to a listed
extension will be considered shippable to the remote server.
But doesn't mention that extensions' custom data types will be pushed down
as well! I feel it's important and worth mentioning.
I noticed that the lookup_shippable() function in shippable.c file does
mention that:
> Returns true if given object (operator/function/type) is shippable
according to the server options.
Src:
https://github.com/postgres/postgres/blob/master/contrib/postgres_fdw/shippable.c#L108
Can you please update the official docs to call out about types? Thank you!
:)
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2024-04-10 10:24 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03 10:57 Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-09 10:19 Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-09 10:36 ` Laurenz Albe <laurenz.albe@cybertec.at>
2024-04-09 14:36 ` Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-10 10:24 ` Rajan Pandey <rajanpandey2508@gmail.com>
2024-04-10 10:24 Postgres_FDW doc doesn't specify TYPE support in Remote Execution Options PG Doc comments form <noreply@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox