pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: fpirotti@gmail.com
Subject: BUG #15315: Trigger on foreign data wrapper (MYSQL) does not update columns not in set clause
Date: Tue, 07 Aug 2018 19:00:00 +0000
Message-ID: <153366840006.1296.5658931833037906278@wrigleys.postgresql.org> (raw)

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



Message-ID: <153366840006.1296.5658931833037906278@wrigleys.postgresql.org>
Permalink:  ../153366840006.1296.5658931833037906278@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/153366840006.1296.5658931833037906278@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, fpirotti@gmail.com
  Subject: Re: BUG #15315: Trigger on foreign data wrapper (MYSQL) does not update columns not in set clause
  In-Reply-To: <153366840006.1296.5658931833037906278@wrigleys.postgresql.org>
  References: <153366840006.1296.5658931833037906278@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox