RE: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-13 Thread shohei.mochizuki
Fujita-san, > From: Etsuro Fujita [mailto:etsuro.fuj...@gmail.com] > > Mochizuki-san, > > On Wed, Jun 12, 2019 at 6:08 PM wrote: > > > On Mon, Jun 10, 2019 at 9:04 PM Etsuro Fujita > > > > > > wrote: > > > > I'll look into the patch more closely tomorrow. > > > > > > I did that, but couldn't f

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-13 Thread Etsuro Fujita
Mochizuki-san, On Wed, Jun 12, 2019 at 6:08 PM wrote: > > On Mon, Jun 10, 2019 at 9:04 PM Etsuro Fujita > > wrote: > > > I'll look into the patch more closely tomorrow. > > > > I did that, but couldn't find any issue about the patch. Here is an updated > > version of the patch. Changes are: >

RE: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-12 Thread shohei.mochizuki
Fujita-san, > On Mon, Jun 10, 2019 at 9:04 PM Etsuro Fujita > wrote: > > I'll look into the patch more closely tomorrow. > > I did that, but couldn't find any issue about the patch. Here is an updated > version of the patch. Changes are: > > * Reworded the comments a bit in postgresPlanFoereig

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-12 Thread Etsuro Fujita
Amit-san, On Wed, Jun 12, 2019 at 3:33 PM Amit Langote wrote: > On Wed, Jun 12, 2019 at 3:14 PM Etsuro Fujita wrote: > > * Reworded the comments a bit in postgresPlanFoereignModify the > > original patch modified > > + * statement, and for UPDATE if BEFORE ROW UPDATE triggers since those > +

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-11 Thread Amit Langote
Fujita-san, On Wed, Jun 12, 2019 at 3:14 PM Etsuro Fujita wrote: > I did that, but couldn't find any issue about the patch. Here is an > updated version of the patch. Thanks for the updating the patch. > Changes are: > > * Reworded the comments a bit in postgresPlanFoereignModify the > origin

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-11 Thread Etsuro Fujita
On Mon, Jun 10, 2019 at 9:04 PM Etsuro Fujita wrote: > I'll look into the patch more closely tomorrow. I did that, but couldn't find any issue about the patch. Here is an updated version of the patch. Changes are: * Reworded the comments a bit in postgresPlanFoereignModify the original patch m

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-11 Thread Amit Langote
Fujita-san, On Tue, Jun 11, 2019 at 6:09 PM Etsuro Fujita wrote: > On Tue, Jun 11, 2019 at 1:31 PM Amit Langote wrote: > > > On Tue, Jun 11, 2019 at 10:51 AM Etsuro Fujita > > > wrote: > > > > Sorry, my explanation was not good; I should have said that in UPDATE, > > > > we fetch columns not m

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-11 Thread Etsuro Fujita
Amit-san, On Tue, Jun 11, 2019 at 1:31 PM Amit Langote wrote: > > On Tue, Jun 11, 2019 at 10:51 AM Etsuro Fujita > > wrote: > > > Sorry, my explanation was not good; I should have said that in UPDATE, > > > we fetch columns not mentioned in the SQL query as well (even if the > > > target table

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-10 Thread Amit Langote
> On Tue, Jun 11, 2019 at 10:51 AM Etsuro Fujita > wrote: > > On Tue, Jun 11, 2019 at 10:30 AM Amit Langote > > wrote: > > > On Mon, Jun 10, 2019 at 9:04 PM Etsuro Fujita > > > wrote: > > > > > On Tue, May 28, 2019 at 12:54 PM Amit Langote > > > > > wrote: > > > > > > On 2019/05/27 22:02, To

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-10 Thread Etsuro Fujita
I forgot to send this by "Reply ALL". On Tue, Jun 11, 2019 at 10:51 AM Etsuro Fujita wrote: > > Amit-san, > > On Tue, Jun 11, 2019 at 10:30 AM Amit Langote wrote: > > On Mon, Jun 10, 2019 at 9:04 PM Etsuro Fujita > > wrote: > > > > On Tue, May 28, 2019 at 12:54 PM Amit Langote > > > > wrote:

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-10 Thread Amit Langote
Fujita-san, Thanks for the comments. On Mon, Jun 10, 2019 at 9:04 PM Etsuro Fujita wrote: > > On Tue, May 28, 2019 at 12:54 PM Amit Langote > > wrote: > > > On 2019/05/27 22:02, Tom Lane wrote: > > > > Perhaps, if the table has relevant BEFORE triggers, we should just > > > > abandon > > > > o

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-06-10 Thread Etsuro Fujita
On Tue, May 28, 2019 at 3:40 PM Etsuro Fujita wrote: > On Tue, May 28, 2019 at 12:54 PM Amit Langote > wrote: > > On 2019/05/27 22:02, Tom Lane wrote: > > > Amit Langote writes: > > >> On 2019/05/27 10:52, Shohei Mochizuki wrote: > > >>> I noticed returning a modified record in a row-level BEFOR

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-05-27 Thread Etsuro Fujita
Hi, On Tue, May 28, 2019 at 12:54 PM Amit Langote wrote: > On 2019/05/27 22:02, Tom Lane wrote: > > Amit Langote writes: > >> On 2019/05/27 10:52, Shohei Mochizuki wrote: > >>> I noticed returning a modified record in a row-level BEFORE UPDATE trigger > >>> on postgres_fdw foreign tables do not

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-05-27 Thread Amit Langote
Mochizuki-san, On 2019/05/28 13:10, Shohei Mochizuki wrote: > On 2019/05/28 12:54, Amit Langote wrote: >> On 2019/05/27 22:02, Tom Lane wrote: >>> Perhaps, if the table has relevant BEFORE triggers, we should just abandon >>> our attempts to optimize away fetching/storing all columns?  It seems li

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-05-27 Thread Shohei Mochizuki
On 2019/05/28 12:54, Amit Langote wrote: On 2019/05/27 22:02, Tom Lane wrote: Amit Langote writes: On 2019/05/27 10:52, Shohei Mochizuki wrote: I noticed returning a modified record in a row-level BEFORE UPDATE trigger on postgres_fdw foreign tables do not work. Attached patch fixes this issu

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-05-27 Thread Amit Langote
On 2019/05/27 22:02, Tom Lane wrote: > Amit Langote writes: >> On 2019/05/27 10:52, Shohei Mochizuki wrote: >>> I noticed returning a modified record in a row-level BEFORE UPDATE trigger >>> on postgres_fdw foreign tables do not work. Attached patch fixes this issue. >>> This is because current fd

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-05-27 Thread Tom Lane
Amit Langote writes: > On 2019/05/27 10:52, Shohei Mochizuki wrote: >> I noticed returning a modified record in a row-level BEFORE UPDATE trigger >> on postgres_fdw foreign tables do not work. Attached patch fixes this issue. >> This is because current fdw code adds only columns to RemoteSQL that

Re: BEFORE UPDATE trigger on postgres_fdw table not work

2019-05-27 Thread Amit Langote
Mochizuki-san, On 2019/05/27 10:52, Shohei Mochizuki wrote: > Hi, > > I noticed returning a modified record in a row-level BEFORE UPDATE trigger > on postgres_fdw foreign tables do not work. Attached patch fixes this issue. > > Without attached patch: > > postgres=# UPDATE rem1 set f1 = 10; > po