Thread: BUG #15315: Trigger on foreign data wrapper (MYSQL) does not updatecolumns not in set clause

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