BUG #15315: Trigger on foreign data wrapper (MYSQL) does not updatecolumns not in set clause - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #15315: Trigger on foreign data wrapper (MYSQL) does not updatecolumns not in set clause
Date
Msg-id 153366840006.1296.5658931833037906278@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15315
Logged by:          Francesco Pirotti
Email address:      fpirotti@gmail.com
PostgreSQL version: 9.6.7
Operating system:   Debian Linux 8
Description:

I have a foreign table "t1" with two columns, "A" and "B" from mysql_fdw
foreign data wrapper.
I have created a trigger so that column B gets automatically a value when A
is updated
  BEGIN
     NEW.B :=   'dummy value';
     RETURN NEW;
  END; 

if I run the following query 
update t1 set A='1'
column B does NOT update as per trigger.
if I run the following query 
update t1 set A='1', B='a'
then column B correctly gets the 'dummy value' from the trigger  function.

I created an identical table in postgresql (create table t2 as select * from
t1), so it is not foreign, and both updates work! 

Thanks for your attention: PostgreSQL 9.6.7 on x86_64-pc-linux-gnu (Debian
9.6.7-1.pgdg80+1), compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15312: Possible access to unintended variable in "postgres/src/backend/postmaster/pgstat.c" line 2698
Next
From: Tom Lane
Date:
Subject: Re: BUG #15271: Documentation / Error reporting on GUC parameter change