Re: Typo in comment for pgstat_database_flush_cb()

2025-04-07 Thread Etsuro Fujita
On Sun, Apr 6, 2025 at 11:44 PM Michael Paquier wrote: > On Sun, Apr 06, 2025 at 01:31:50PM +0200, Etsuro Fujita wrote: > > +1 for both suggestions. So I modified the comment as such in each > > file with such a flush_cb function. I will push the patch. > > Thanks for the

Re: Thinko in pgstat_build_snapshot()

2025-04-06 Thread Etsuro Fujita
On Sun, Mar 30, 2025 at 10:47 PM Gurjeet Singh wrote: > On Sun, Mar 30, 2025 at 4:31 AM Heikki Linnakangas wrote: > > On 30/03/2025 13:23, Etsuro Fujita wrote: > > > While working on something else I noticed $SUBJECT: we are allocating > > > more memory than necessary

Re: Typo in comment for pgstat_database_flush_cb()

2025-04-06 Thread Etsuro Fujita
On Sun, Mar 30, 2025 at 7:54 PM Gurjeet Singh wrote: > On Sun Mar 30, 2025 at 4:39 AM PDT, Heikki Linnakangas wrote: > > On 30/03/2025 14:32, Heikki Linnakangas wrote: > >> On 30/03/2025 13:28, Etsuro Fujita wrote: > >>> Another thing I noticed is $SUBJE

Typo in comment for pgstat_database_flush_cb()

2025-03-30 Thread Etsuro Fujita
Another thing I noticed is $SUBJECT: I think “if lock could not immediately acquired” should be “if lock could not be immediately acquired”. Attached is a patch for that. Best regards, Etsuro Fujita fix-typo-in-comment.patch Description: Binary data

Thinko in pgstat_build_snapshot()

2025-03-30 Thread Etsuro Fujita
large number of variables stats, so I fixed it. Attached is a patch for that. Best regards, Etsuro Fujita fix-thinko-in-pgstat_build_snapshot.patch Description: Binary data

Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-30 Thread Etsuro Fujita
On Thu, Mar 27, 2025 at 1:25 PM Ashutosh Bapat wrote: > On Tue, Mar 25, 2025 at 4:01 PM Etsuro Fujita wrote: > > In the patch I also fixed a bug; I trusted XactReadOnly to see if the > > local transaction is READ ONLY, but I noticed that that is not 100% > > correct, becaus

Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-25 Thread Etsuro Fujita
On Mon, Mar 3, 2025 at 1:51 PM Ashutosh Bapat wrote: > On Sun, Mar 2, 2025 at 5:14 PM Etsuro Fujita wrote: > > postgres_fdw opens remote transactions in read/write mode in a local > > transaction even if the local transaction is read-only. I noticed > > that this leads t

Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-25 Thread Etsuro Fujita
On Mon, Mar 3, 2025 at 4:49 PM Tom Lane wrote: > Ashutosh Bapat writes: > > On Sun, Mar 2, 2025 at 5:14 PM Etsuro Fujita > > wrote: > >> To avoid that, I would like to propose a server option, > >> inherit_read_only, to open the remote transactions in

Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-02 Thread Etsuro Fujita
On Sun, Mar 2, 2025 at 12:44 PM Etsuro Fujita wrote: > Attached is a small patch for these options. I will add this to the > March commitfest as it is still open. The CF was changed to in-progress just before, so I added it to the next CF. Best regards, Etsuro Fujita

Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-02 Thread Etsuro Fujita
pose a server option, inherit_deferrable, to open the remote transactions in deferrable mode if the local transaction is deferrable. Attached is a small patch for these options. I will add this to the March commitfest as it is still open. Best regards, Etsuro Fujita Inherit-xact-properties-i

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-07 Thread Etsuro Fujita
query uses simple query protocol, we can avoid the extra communication by sending the two queries in a single function call. I will do that in the next version. Thanks for the comment! Best regards, Etsuro Fujita

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-07 Thread Etsuro Fujita
if such open cursors exist on the main server, so cursor foo is guaranteed to scan ft2 using the same snapshot that was used to scan ft1. Thank you for taking the time for this proposal! Best regards, Etsuro Fujita

postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-05 Thread Etsuro Fujita
'bar'); S2: SELECT * FROM ft1; c1 - foo bar (2 rows) The SELECT query retrieves both rows! Comments welcome! Maybe I am missing something, though. Best regards, Etsuro Fujita postgres_fdw-emulate-RC-behavior-WIP.patch Description: Binary data

Re: list of acknowledgments for PG17

2024-08-27 Thread Etsuro Fujita
ame is Kouhei. Thanks! Best regards, Etsuro Fujita

Re: Cross-version Compatibility of postgres_fdw

2024-08-27 Thread Etsuro Fujita
On Tue, Aug 20, 2024 at 8:55 AM Bruce Momjian wrote: > I think it is an improvement, so applied to master. Thanks. Thanks for taking care of this! Best regards, Etsuro Fujita

Re: Skip adding row-marks for non target tables when result relation is foreign table.

2024-08-15 Thread Etsuro Fujita
On Thu, Aug 15, 2024 at 9:56 AM Jeff Davis wrote: > Is there any sample code that implements late locking for a FDW? I'm > not quite clear on how it's supposed to work. See the patch in [1]. It would not apply to HEAD anymore, though. Best regards, Etsuro Fujita [1] https://ww

Re: Cross-version Compatibility of postgres_fdw

2024-08-13 Thread Etsuro Fujita
rify that > such cases work. I'm not volunteering to make that happen, though. +1 to both. Unfortunately, I do not think I will have time for that, though. Best regards, Etsuro Fujita

Re: Cross-version Compatibility of postgres_fdw

2024-08-13 Thread Etsuro Fujita
On Tue, Aug 13, 2024 at 12:15 PM Fujii Masao wrote: > On 2024/08/09 17:49, Etsuro Fujita wrote: > > I just thought consolidating the information to one place would make > > the documentation more readable. > > Yes, so I think that adding a note about the required remote se

Re: Cross-version Compatibility of postgres_fdw

2024-08-09 Thread Etsuro Fujita
and the latter part a little bit like: However, the ON CONFLICT DO NOTHING clause is supported, provided a unique index inference specification is omitted and the remote server is 9.5 or later. I just thought consolidating the information to one place would make the documentation more readable. Best regards, Etsuro Fujita

Re: Skip adding row-marks for non target tables when result relation is foreign table.

2024-08-09 Thread Etsuro Fujita
are returned by the query; > in the case of a join query, the rows locked are those that contribute > to returned join rows." Yeah, but I think this holds true for SELECT queries postgres_fdw sends to the remote side. :) Best regards, Etsuro Fujita

Re: Comment in portal.h

2024-08-01 Thread Etsuro Fujita
Hi, On Wed, Jul 31, 2024 at 8:55 AM Andy Fan wrote: > Etsuro Fujita writes: > > I noticed $SUBJECT while working on something else: > > > > /* > > * Where we store tuples for a held cursor or a PORTAL_ONE_RETURNING or > > * PORTAL_UTIL_SELECT query

Comment in portal.h

2024-07-30 Thread Etsuro Fujita
query.". Attached is a patch for that. Best regards, Etsuro Fujita update-comment.patch Description: Binary data

Re: d844cd75a and postgres_fdw

2024-07-18 Thread Etsuro Fujita
On Fri, Jul 5, 2024 at 9:56 PM Etsuro Fujita wrote: > On Tue, Oct 24, 2023 at 8:48 PM Devrim Gündüz wrote: > > I'm seeing an issue after upgrading from 12.13 to 15.4. This happens > > when we run a query against a foreign table (fdw on the same instance to > > a diffe

Re: d844cd75a and postgres_fdw

2024-07-05 Thread Etsuro Fujita
tus = 'A' > AND tbl.table_id <> 1 > AND tbl.table_id <> - 2 > > Any hints? The error occurs when rescanning a postgres_fdw foreign relation, so I think the reason why the query works would be that the planner chose a join plan other than a nestloop joi

Re: Another WaitEventSet resource leakage in back branches

2024-04-12 Thread Etsuro Fujita
Hi Andres, On Fri, Apr 12, 2024 at 1:29 AM Andres Freund wrote: > On 2024-03-22 21:15:45 +0900, Etsuro Fujita wrote: > > While working on [1], I noticed $SUBJECT: WaitLatchOrSocket in back > > branches is ignoring the possibility of failing partway through, too. > > I adde

Re: Comment about handling of asynchronous requests in postgres_fdw.c

2024-04-11 Thread Etsuro Fujita
On Wed, Apr 10, 2024 at 8:51 PM Etsuro Fujita wrote: > We updated $SUBJECT in back branches to make it clear (see commit > f6f61a4bd), so I would like to propose to do so in HEAD as well for > consistency. Attached is a patch for that. Pushed. Best regards, Etsuro Fujita

Re: Another WaitEventSet resource leakage in back branches

2024-04-11 Thread Etsuro Fujita
On Fri, Apr 5, 2024 at 7:55 PM Etsuro Fujita wrote: > I am planning to back-patch these next week. Done. Best regards, Etsuro Fujita

Comment about handling of asynchronous requests in postgres_fdw.c

2024-04-10 Thread Etsuro Fujita
Hi, We updated $SUBJECT in back branches to make it clear (see commit f6f61a4bd), so I would like to propose to do so in HEAD as well for consistency. Attached is a patch for that. Best regards, Etsuro Fujita postgres-fdw-comment.patch Description: Binary data

Re: postgres_fdw fails because GMT != UTC

2024-04-10 Thread Etsuro Fujita
I think the first is desirable for reasons of general sanity, and the > second for best compatibility with old versions. > > So I vote for "both". +1 for both (assuming that the latter does not make the postgres_fdw code complicated). Best regards, Etsuro Fujita

Re: Another WaitEventSet resource leakage in back branches

2024-04-05 Thread Etsuro Fujita
On Fri, Mar 22, 2024 at 9:15 PM Etsuro Fujita wrote: > While working on [1], I noticed $SUBJECT: WaitLatchOrSocket in back > branches is ignoring the possibility of failing partway through, too. > I added a PG_FAINALLY block to that function, like commit 555276f85. > Patch attached

Re: postgres_fdw: Useless test in pgfdw_exec_cleanup_query_end()

2024-04-04 Thread Etsuro Fujita
On Fri, Mar 22, 2024 at 9:30 PM Etsuro Fujita wrote: > If there are no objections, I will apply the patch to HEAD only. Done. Best regards, Etsuro Fujita

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-04-04 Thread Etsuro Fujita
On Fri, Mar 22, 2024 at 9:09 PM Etsuro Fujita wrote: > On Fri, Mar 22, 2024 at 7:23 PM Alexander Pyhalov > wrote: > > The updated patch still looks good to me. > > I am planning to apply the patch to the back branches next week. Pushed. Sorry for the delay. Best regards, Etsuro Fujita

postgres_fdw: Useless test in pgfdw_exec_cleanup_query_end()

2024-03-22 Thread Etsuro Fujita
assertion ensuring that the query string is non-NULL. (I added the assertion to pgfdw_exec_cleanup_query_begin() as well.) Attached is a patch for that. If there are no objections, I will apply the patch to HEAD only. Best regards, Etsuro Fujita [1] https://www.postgresql.org/message-id

Another WaitEventSet resource leakage in back branches

2024-03-22 Thread Etsuro Fujita
Hi, While working on [1], I noticed $SUBJECT: WaitLatchOrSocket in back branches is ignoring the possibility of failing partway through, too. I added a PG_FAINALLY block to that function, like commit 555276f85. Patch attached. Best regards, Etsuro Fujita [1] https://www.postgresql.org/message

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-03-22 Thread Etsuro Fujita
Hi Alexander, On Fri, Mar 22, 2024 at 7:23 PM Alexander Pyhalov wrote: > The updated patch still looks good to me. Great! I am planning to apply the patch to the back branches next week. Thanks for the review! Best regards, Etsuro Fujita

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-03-21 Thread Etsuro Fujita
On Sun, Feb 25, 2024 at 6:34 PM Etsuro Fujita wrote: > > On Fri, Feb 23, 2024 at 01:21:14PM +0300, Alexander Pyhalov wrote: > > > Recent commit 555276f8594087ba15e0d58e38cd2186b9f39f6d introduced final > > > cleanup of node->as_eventset in ExecAppendAsyncEventWait(

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-03-11 Thread Etsuro Fujita
Hi Michael-san, On Mon, Mar 11, 2024 at 8:12 AM Michael Paquier wrote: > On Mon, Feb 26, 2024 at 04:29:44PM +0900, Etsuro Fujita wrote: > > Will do. (I was thinking you would get busy from now on.) > > Fujita-san, have you been able to look at this thread? Yeah, I took a look;

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-02-25 Thread Etsuro Fujita
a fix for resource leaks in my commit 27e1f1456. > Anyway, if you want to address it yourself, feel free to go ahead, > thanks! I would have done it but I've been busy with life stuff for > the last couple of days. Will do. (I was thinking you would get busy from now on.) Best regards, Etsuro Fujita

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-02-25 Thread Etsuro Fujita
> I'll look into fixing that where appropriate. Thanks for taking care of this, Michael-san! This would result originally from my fault, so If you don't mind, could you let me do that? Best regards, Etsuro Fujita

Re: Incorrect file reference in comment in procarray.c

2023-11-13 Thread Etsuro Fujita
On Fri, Nov 3, 2023 at 6:53 PM Etsuro Fujita wrote: > On Thu, Nov 2, 2023 at 10:20 PM Daniel Gustafsson wrote: > > > On 2 Nov 2023, at 13:40, Etsuro Fujita wrote: > > > Attached is a small patch for that: s/heapam_visibility.c/snapmgr.c/. > > > > No objec

Re: Incorrect file reference in comment in procarray.c

2023-11-03 Thread Etsuro Fujita
On Thu, Nov 2, 2023 at 10:20 PM Daniel Gustafsson wrote: > > On 2 Nov 2023, at 13:40, Etsuro Fujita wrote: > > Attached is a small patch for that: s/heapam_visibility.c/snapmgr.c/. > > No objections to the patch, the change is correct. However, with git grep and > ct

Incorrect file reference in comment in procarray.c

2023-11-02 Thread Etsuro Fujita
sibility.c/snapmgr.c/. Best regards, Etsuro Fujita fix-file-reference-in-comment.patch Description: Binary data

Re: Avoid a possible out-of-bounds access (src/backend/optimizer/util/relnode.c)

2023-09-23 Thread Etsuro Fujita
eturn a > negative value, which may occur on some production servers. > > Fix by changing the Assertion into a real test, to protect the > simple_rel_array array. Thanks for the report and patch! I will review the patch. Best regards, Etsuro Fujita

Re: Comment about set_join_pathlist_hook()

2023-09-21 Thread Etsuro Fujita
Hi, On Wed, Sep 20, 2023 at 7:49 PM David Rowley wrote: > On Wed, 20 Sept 2023 at 22:06, Etsuro Fujita wrote: > > So I would like to propose to extend the comment to explain what they > > can do, as in the comment about set_rel_pathlist_hook() in allpaths.c. > > Attache

Re: Comment about set_join_pathlist_hook()

2023-09-20 Thread Etsuro Fujita
Hi, On Thu, Sep 21, 2023 at 11:49 AM Lepikhov Andrei wrote: > On Wed, Sep 20, 2023, at 5:05 PM, Etsuro Fujita wrote: > > What I am concerned about from the report [1] is that this comment is > > a bit too terse; it might cause a misunderstanding that extensions can > > do

Comment about set_join_pathlist_hook()

2023-09-20 Thread Etsuro Fujita
that. Best regards, Etsuro Fujita [1] https://www.postgresql.org/message-id/CACawEhV%3D%2BQ0HXrcDergbTR9EkVFukgRPMTZbRFL-YK5CRmvYag%40mail.gmail.com update-set_join_pathlist_hook-comment.patch Description: Binary data

Re: Missing comments/docs about custom scan path

2023-08-30 Thread Etsuro Fujita
Hi Richard, On Wed, Aug 30, 2023 at 11:05 AM Richard Guo wrote: > On Tue, Aug 29, 2023 at 5:08 PM Etsuro Fujita wrote: >> Another thing I would like to propose is minor adjustments to the docs >> related to parallel query: >> >> A custom scan provider will typ

Re: Test case for parameterized remote path in postgres_fdw

2023-08-30 Thread Etsuro Fujita
On Wed, Aug 16, 2023 at 6:45 PM Etsuro Fujita wrote: > On Wed, Aug 16, 2023 at 9:41 AM Richard Guo wrote: > > On Tue, Aug 15, 2023 at 7:50 PM Etsuro Fujita > > wrote: > >> So we should have modified the second one as well? Attached is a > >> small patch for th

Re: Missing comments/docs about custom scan path

2023-08-29 Thread Etsuro Fujita
On Thu, Aug 3, 2023 at 6:01 PM Etsuro Fujita wrote: > On Mon, Jul 31, 2023 at 7:05 PM Etsuro Fujita wrote: > > While working on [1], I noticed $SUBJECT: Another thing I would like to propose is minor adjustments to the docs related to parallel query: A custom scan provider will

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-29 Thread Etsuro Fujita
e this to think about it. Reverting the commit would resolve your issue, but re-introduce the issue mentioned upthread to extensions that use the hook properly, so I do not think that reverting the commit would be a fair action. Sorry for the delay. Best regards, Etsuro Fujita

Re: list of acknowledgments for PG16

2023-08-23 Thread Etsuro Fujita
list. I think they are all in the right order (ie, the given-name-followed-by-surname order). Thanks! Best regards, Etsuro Fujita

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-21 Thread Etsuro Fujita
Sorry, I hit the send button by mistake. On Sun, Aug 20, 2023 at 4:34 AM Andres Freund wrote: > On 2023-08-19 20:09:25 +0900, Etsuro Fujita wrote: > > * The problem we had with the set_join_pathlist_hook hook is that in > > such a typical use case, previously, if the replace

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-21 Thread Etsuro Fujita
Hi, On Sun, Aug 20, 2023 at 4:34 AM Andres Freund wrote: > > Hi, > > On 2023-08-19 20:09:25 +0900, Etsuro Fujita wrote: > > Maybe my explanation was not enough, so let me explain: > > > > * I think you could use the set_join_pathlist_hook hook as you like at &g

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-19 Thread Etsuro Fujita
h I guess are the majority of the hook extensions, need not be modified/recompiled. I think it is unfortunate that that breaks the use case of the Citus extension, though. BTW: commit 9e9931d2b removed the restriction on the call to the hook extensions, so you might want to back-patch it. Though, I think it would be better if the hook was well implemented from the beginning. Best regards, Etsuro Fujita

Re: Test case for parameterized remote path in postgres_fdw

2023-08-16 Thread Etsuro Fujita
Hi Richard, On Wed, Aug 16, 2023 at 9:41 AM Richard Guo wrote: > On Tue, Aug 15, 2023 at 7:50 PM Etsuro Fujita wrote: >> So we should have modified the second one as well? Attached is a >> small patch for that. > Agreed, nice catch! +1 to the patch. Thanks for looking! Be

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-16 Thread Etsuro Fujita
familiar with the Citus extension, but such pseudoconstant clauses are handled within the Citus extension? Thanks for the report! Best regards, Etsuro Fujita

Test case for parameterized remote path in postgres_fdw

2023-08-15 Thread Etsuro Fujita
c6, r1.c7, r1.c8, r2."C 1", r2.c2, r2.c3, r2.c4, r2.c5, r2.c6, r2.c7, r2.c8 FROM ("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (((r1.c2 = r2."C 1")) AND ((r1."C 1" = 47 (4 rows) So we should have modified the second one as

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-15 Thread Etsuro Fujita
On Tue, Aug 8, 2023 at 6:30 PM Richard Guo wrote: > On Tue, Aug 8, 2023 at 4:40 PM Etsuro Fujita wrote: >> I modified the code a bit further to use an if-test to avoid a useless >> function call, and added/tweaked comments and docs further. Attached >> is a new versio

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-08 Thread Etsuro Fujita
Hi Richard, On Mon, Jul 31, 2023 at 5:52 PM Richard Guo wrote: > On Fri, Jul 28, 2023 at 4:56 PM Etsuro Fujita wrote: >> here is a rebased version of the second patch, in which I modified the >> ForeignPath and CustomPath cases in reparameterize_path_by_child() to >> re

Re: Missing comments/docs about custom scan path

2023-08-03 Thread Etsuro Fujita
On Mon, Jul 31, 2023 at 7:05 PM Etsuro Fujita wrote: > While working on [1], I noticed $SUBJECT: commit e7cb7ee14 failed to > update comments for the CustomPath struct in pathnodes.h, and commit > f49842d1e failed to update docs about custom scan path callbacks in > custom-sca

Missing comments/docs about custom scan path

2023-07-31 Thread Etsuro Fujita
separately for ease of review (patch update-custom-scan-path-comments.patch for the former and patch update-custom-scan-path-docs.patch for the latter). In the second patch I used almost the same text as for the ReparameterizeForeignPathByChild callback function in fdwhandler.sgml. Best regards, Etsuro

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-07-28 Thread Etsuro Fujita
Hi Richard, On Mon, Jul 24, 2023 at 11:45 AM Richard Guo wrote: > On Fri, Jul 21, 2023 at 8:51 PM Etsuro Fujita wrote: >> * In this bit I changed the last argument to NIL, which would be >> nitpicking, though. >> >> @@ -1038,7 +1038,7 @@ postgresGetForeignPaths(Plann

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-07-21 Thread Etsuro Fujita
Hi Richard, On Sun, Jun 25, 2023 at 3:05 PM Richard Guo wrote: > On Wed, Jun 14, 2023 at 2:49 PM Etsuro Fujita wrote: >> On Mon, Jun 5, 2023 at 10:19 PM Etsuro Fujita >> wrote: >> > To avoid this issue, I am wondering if we should modify >> > add_paths_to_join

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-06-13 Thread Etsuro Fujita
On Mon, Jun 5, 2023 at 10:19 PM Etsuro Fujita wrote: > To avoid this issue, I am wondering if we should modify > add_paths_to_joinrel() in back branches so that it just disallows the > FDW to consider pushing down joins when the restrictlist has > pseudoconstant clauses. Attached is

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-06-08 Thread Etsuro Fujita
type of query execution won't make any difference. No comparison of plans to > be selected based on total cost of two plans old (Nested Loop with Foreign > Scans) & new (Only Foreign Scan) will be done, because we are avoiding the > call to "postgresGetForeignJoinPaths()" up front when we have pseudo > constants. Thanks for looking! Best regards, Etsuro Fujita

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-06-08 Thread Etsuro Fujita
Hi Richard, On Tue, Jun 6, 2023 at 12:20 PM Richard Guo wrote: > On Mon, Jun 5, 2023 at 9:19 PM Etsuro Fujita wrote: >> To avoid this issue, I am wondering if we should modify >> add_paths_to_joinrel() in back branches so that it just disallows the >> FDW to consider pushin

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-06-05 Thread Etsuro Fujita
shing down joins when the restrictlist has pseudoconstant clauses. Attached is a patch for that. My apologies for not reviewing your patch and the long long delay. Best regards, Etsuro Fujita disallow-join-pushdown-if-pseudoconstants.patch Description: Binary data

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-04-24 Thread Etsuro Fujita
On Mon, Apr 24, 2023 at 3:31 PM Nishant Sharma wrote: > Any updates? -- did you get a chance to look into this? Sorry, I have not looked into this yet, because I have been busy with some other work recently. I plan to do so early next week. Best regards, Etsuro Fujita

Re: Issue in postgres_fdw causing unnecessary wait for cancel request reply

2023-04-16 Thread Etsuro Fujita
On Fri, Apr 14, 2023 at 11:28 PM Fujii Masao wrote: > On 2023/04/14 18:59, Etsuro Fujita wrote: > >> The primary message basically should avoid reference to implementation > >> details such as specific structure names like PGcancel, shouldn't it, as > >>

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-04-14 Thread Etsuro Fujita
root cause for this issue would be in the create_scan_plan handling of pseudoconstant quals when creating a foreign-join (or custom-join) plan. Anyway, I will look at your patch closely, first. Best regards, Etsuro Fujita

Re: Issue in postgres_fdw causing unnecessary wait for cancel request reply

2023-04-14 Thread Etsuro Fujita
On Fri, Apr 14, 2023 at 3:19 AM Fujii Masao wrote: > On 2023/04/13 15:13, Etsuro Fujita wrote: > > I am not 100% sure that it is a good idea to use the same error > > message "could not send cancel request" for the PQgetCancel() and > > PQcancel() cases, because the

Re: Issue in postgres_fdw causing unnecessary wait for cancel request reply

2023-04-12 Thread Etsuro Fujita
or something like that, for the former case, so we can distinguish the former error from the latter? Best regards, Etsuro Fujita

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2023-04-06 Thread Etsuro Fujita
On Tue, Apr 4, 2023 at 7:28 PM Etsuro Fujita wrote: > The parallel-abort patch received a review from David, and I addressed > his comments. Also, he tested with the patch, and showed that it > reduces time taken to abort remote transactions. So, if there are no > objections, I wil

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2023-04-04 Thread Etsuro Fujita
On Wed, Jan 18, 2023 at 8:06 PM Etsuro Fujita wrote: > I rebased the patch. Attached is an updated patch. The parallel-abort patch received a review from David, and I addressed his comments. Also, he tested with the patch, and showed that it reduces time taken to abort remote transactions.

Re: Commitfest 2023-03 starting tomorrow!

2023-03-25 Thread Etsuro Fujita
wants to work on this, please do so; if not, I want to in the next development cycle for v17. Best regards, Etsuro Fujita

Re: Doc: Improve note about copying into postgres_fdw foreign tables in batch

2023-03-23 Thread Etsuro Fujita
of the patch. > > LGTM. Cool! Pushed. Thanks again! Best regards, Etsuro Fujita

Re: Doc: Improve note about copying into postgres_fdw foreign tables in batch

2023-03-23 Thread Etsuro Fujita
s. seems more appropriate to me as well in this context, so I left it alone. Attached is an updated version of the patch. Thanks for looking, Daniel and Ishii-san! Best regards, Etsuro Fujita postgres-fdw-batch-insert-doc-v2.patch Description: Binary data

Re: Doc: Improve note about copying into postgres_fdw foreign tables in batch

2023-03-22 Thread Etsuro Fujita
On Fri, Feb 17, 2023 at 5:45 PM Etsuro Fujita wrote: > Here is a small patch to improve the note, which was added by commit > 97da48246 ("Allow batch insertion during COPY into a foreign table."), > by adding an explanation about how the actual number of rows > postgres_

Re: Comment in preptlist.c

2023-03-22 Thread Etsuro Fujita
On Wed, Mar 22, 2023 at 4:50 PM David Rowley wrote: > And now it just clicked with me why Tom left this. Sorry for stepping > on your toes here. No problem at all. Best regards, Etsuro Fujita

Re: Comment in preptlist.c

2023-03-22 Thread Etsuro Fujita
On Wed, Mar 22, 2023 at 4:59 AM David Rowley wrote: > On Tue, 21 Mar 2023 at 22:41, Etsuro Fujita wrote: > > I think that “planner/rewriter” should be parser/rewriter. Attached > > is a patch for that. > > Pushed. Thanks for picking this up, David! Thanks for looking, T

Comment in preptlist.c

2023-03-21 Thread Etsuro Fujita
row. (The planner * adds these; they're not in what we receive from the planner/rewriter.) I think that “planner/rewriter” should be parser/rewriter. Attached is a patch for that. Best regards, Etsuro Fujita fix-comment.patch Description: Binary data

Re: postgres_fdw: Useless if-test in GetConnection()

2023-03-17 Thread Etsuro Fujita
On Wed, Mar 15, 2023 at 7:18 PM Etsuro Fujita wrote: > This would be harmless, so I am planning to apply the patch to HEAD only. I forgot to mention that this was added in v14. Done that way. Best regards, Etsuro Fujita

Re: postgres_fdw: Useless if-test in GetConnection()

2023-03-16 Thread Etsuro Fujita
On Wed, Mar 15, 2023 at 7:58 PM Daniel Gustafsson wrote: > > On 15 Mar 2023, at 11:18, Etsuro Fujita wrote: > > While working on something else, I noticed that the “if (entry->conn > > == NULL)” test after doing disconnect_pg_server() when re-establishing > > a given

Re: postgres_fdw: Useless if-test in GetConnection()

2023-03-16 Thread Etsuro Fujita
On Wed, Mar 15, 2023 at 7:40 PM Richard Guo wrote: > On Wed, Mar 15, 2023 at 6:18 PM Etsuro Fujita wrote: >> While working on something else, I noticed that the “if (entry->conn >> == NULL)” test after doing disconnect_pg_server() when re-establishing >> a given connecti

postgres_fdw: Useless if-test in GetConnection()

2023-03-15 Thread Etsuro Fujita
hed is a patch for that. I think we could instead add an assertion, but I did not, because we already have it in make_new_connection(). This would be harmless, so I am planning to apply the patch to HEAD only. Best regards, Etsuro Fujita remove-useless-if-test.patch Description: Binary data

Doc: Improve note about copying into postgres_fdw foreign tables in batch

2023-02-17 Thread Etsuro Fujita
ation that does not apply to the INSERT case. I will add this to the next CF. Best regards, Etsuro Fujita postgres-fdw-batch-insert-doc.patch Description: Binary data

Re: Some revises in adding sorting path

2023-02-16 Thread Etsuro Fujita
he EPQ merge-join path of a higher-level foreign join, so shouldn't we keep this step as much as simple and save cycles even a little? Sorry for being late to the party. Best regards, Etsuro Fujita

Re: Refactoring postgres_fdw/connection.c

2023-02-15 Thread Etsuro Fujita
On Tue, Jan 31, 2023 at 3:44 PM Fujii Masao wrote: > On 2023/01/29 19:31, Etsuro Fujita wrote: > > I agree that if the name of an existing function was bad, we should > > rename it, but I do not think the name pgfdw_get_cleanup_result is > > bad; I think it is good in t

Re: Refactoring postgres_fdw/connection.c

2023-01-29 Thread Etsuro Fujita
Hi Fujii-san, On Thu, Sep 15, 2022 at 12:17 AM Fujii Masao wrote: > On 2022/09/05 15:17, Etsuro Fujita wrote: > > I'm not sure it's a good idea to change the function's name, because > > that would make backpatching hard. To avoid that, how about > >

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2023-01-18 Thread Etsuro Fujita
Hi Vignesh, On Wed, Jan 4, 2023 at 9:19 PM vignesh C wrote: > On Tue, 1 Nov 2022 at 15:54, Etsuro Fujita wrote: > > Attached is a rebased version of the patch. > > The patch does not apply on top of HEAD as in [1], please post a rebased > patch: I rebased the patch. Atta

Re: Allow batched insert during cross-partition updates

2022-12-20 Thread Etsuro Fujita
Hi Amit-san, On Wed, Dec 14, 2022 at 10:29 PM Amit Langote wrote: > On Wed, Dec 14, 2022 at 6:45 PM Etsuro Fujita wrote: > > One thing I noticed is this bit: > > > > -- Clean up > > -DROP TABLE batch_table, batch_cp_upd_test, batch_table_p0, > > batch_

Re: Allow batched insert during cross-partition updates

2022-12-14 Thread Etsuro Fujita
On Thu, Dec 8, 2022 at 8:01 PM Etsuro Fujita wrote: > On Thu, Dec 8, 2022 at 5:00 PM Amit Langote wrote: > > Updated patch attached. > > I will review the patch a bit more, but I think > it would be committable. One thing I noticed is this bit: -- Clean up -DROP

Re: Allow batched insert during cross-partition updates

2022-12-08 Thread Etsuro Fujita
Amit-san, On Thu, Dec 8, 2022 at 5:00 PM Amit Langote wrote: > On Tue, Dec 6, 2022 at 6:47 PM Etsuro Fujita wrote: > > * In postgresGetForeignModifyBatchSize(): > > > > /* > > -* Should never get called when the insert is being performed as part >

Re: postgres_fdw: batch inserts vs. before row triggers

2022-12-07 Thread Etsuro Fujita
On Fri, Dec 2, 2022 at 4:54 PM Etsuro Fujita wrote: > On Sun, Nov 27, 2022 at 12:11 AM Tom Lane wrote: > > OK, as long as there's a reason for doing it that way, it's OK > > by me. I don't think that adding a field at the end of EState > > is an ABI problem.

Re: Allow batched insert during cross-partition updates

2022-12-06 Thread Etsuro Fujita
which means that any fmstate should have fmstate->aux_fmstate=NULL. * Also in that function: - if (fmstate) + if (fmstate != NULL) This is correct, but I would vote for leaving that as-is, to make back-patching easy. That is all I have for now. I will mark this as Waiting on Author.

Re: postgres_fdw: batch inserts vs. before row triggers

2022-12-01 Thread Etsuro Fujita
On Sun, Nov 27, 2022 at 12:11 AM Tom Lane wrote: > Etsuro Fujita writes: > > On Sat, Nov 26, 2022 at 1:57 AM Tom Lane wrote: > >> Couldn't we add the field to ModifyTableState, instead? > > > We could probably do so, but I thought having a global list would

Re: postgres_fdw: batch inserts vs. before row triggers

2022-11-26 Thread Etsuro Fujita
to ModifyTableState, instead? We could probably do so, but I thought having a global list would be more efficient to handle pending buffered inserts than that. Anyway I will work on this further. Thanks for looking at this! Best regards, Etsuro Fujita

Re: postgres_fdw: batch inserts vs. before row triggers

2022-11-25 Thread Etsuro Fujita
On Thu, Nov 24, 2022 at 8:19 PM Etsuro Fujita wrote: > Here is an updated patch. In the attached, I added an assertion to > ExecInsert(). Also, I tweaked comments and test cases a little bit, > for consistency. Also, I noticed a copy-and-pasteo in a comment in > ExecBatchInsert()

Re: postgres_fdw: batch inserts vs. before row triggers

2022-11-24 Thread Etsuro Fujita
On Fri, Nov 18, 2022 at 8:46 PM Etsuro Fujita wrote: > Attached is a patch for fixing these issues. Here is an updated patch. In the attached, I added an assertion to ExecInsert(). Also, I tweaked comments and test cases a little bit, for consistency. Also, I noticed a copy-and-pasteo i

Re: postgres_fdw: batch inserts vs. before row triggers

2022-11-18 Thread Etsuro Fujita
or es_opened_result_relations each time when flushing pending inserts to the foreign tables. Best regards, Etsuro Fujita fix-handling-of-pending-inserts.patch Description: Binary data

  1   2   3   4   5   6   7   8   9   >