Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2025-01-14 Thread Robert Haas
On Sat, Dec 7, 2024 at 4:03 AM Etsuro Fujita wrote: > On Fri, Dec 6, 2024 at 2:37 AM Robert Haas wrote: > > I have a hard time seeing how this would work if cursors are in use on > > the main server. Say I do this: > > > > DECLARE foo CURSOR FOR SELECT * FROM ft1 UNION ALL SELECT * FROM ft2; > >

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-07 Thread Andy Fan
Etsuro Fujita writes: > On Fri, Dec 6, 2024 at 7:50 PM Andy Fan wrote: >> Apart from the above issue, what do you think about that we are using a >> 'SELECT pg_catalog.pg_refresh_snapshot()' to let the remote do the >> refresh_snapshot VS 'a new message type for this'? There are lots of >> thin

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-07 Thread Etsuro Fujita
On Fri, Dec 6, 2024 at 7:50 PM Andy Fan wrote: > Apart from the above issue, what do you think about that we are using a > 'SELECT pg_catalog.pg_refresh_snapshot()' to let the remote do the > refresh_snapshot VS 'a new message type for this'? There are lots of > things happen in the 'SELECT' way

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-07 Thread Etsuro Fujita
On Fri, Dec 6, 2024 at 2:37 AM Robert Haas wrote: > I have a hard time seeing how this would work if cursors are in use on > the main server. Say I do this: > > DECLARE foo CURSOR FOR SELECT * FROM ft1 UNION ALL SELECT * FROM ft2; > ...fetch some rows from cursor foo but few enough that we only sc

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-06 Thread Andy Fan
Robert Haas writes: > On Thu, Dec 5, 2024 at 4:41 AM Etsuro Fujita wrote: >> Comments welcome! Maybe I am missing something, though. > > I have a hard time seeing how this would work if cursors are in use on > the main server. Say I do this: > > DECLARE foo CURSOR FOR SELECT * FROM ft1 UNION AL

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-05 Thread Robert Haas
On Thu, Dec 5, 2024 at 4:41 AM Etsuro Fujita wrote: > Comments welcome! Maybe I am missing something, though. I have a hard time seeing how this would work if cursors are in use on the main server. Say I do this: DECLARE foo CURSOR FOR SELECT * FROM ft1 UNION ALL SELECT * FROM ft2; ...fetch som

postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-05 Thread Etsuro Fujita
Hi, postgres_fdw uses REPEATABLE READ isolation level for the remote transaction when the local transaction has READ COMMITTED isolation level, for the reason described in the comments for begin_remote_xact() in connection.c: /* * Start remote transaction or subtransaction, if needed. * * Note