mysql_fdw icon indicating copy to clipboard operation
mysql_fdw copied to clipboard

[Feature Support] Add DEFAULT value when INSERT/UPDATE to generated column

Open khieuvm opened this issue 2 years ago • 1 comments

Original behavior of postgres_fdw: Because the generated column value is handled by the remote server, the local server does not need to assign value to this column -> postgres_fdw sets its value as "DEFAULT".

So currently, we have already implemented this behavior same as postgres_fdw. I would like to contribute them to the repository and community. I will create a pull request to share this feature if you have any interest.

Example explain verbose:

explain (verbose, costs off)
insert into grem1 (a) values (1), (2);
                                             QUERY PLAN                                             
----------------------------------------------------------------------------------------------------
 Insert on public.grem1
   Remote query: INSERT INTO `mysql_fdw_post`.`gloc1_post14`(`id`, `a`, `b`) VALUES (?, ?, DEFAULT)
   ->  Values Scan on "*VALUES*"
         Output: NULL::integer, "*VALUES*".column1, NULL::integer
(5 rows)

khieuvm avatar Mar 29 '22 10:03 khieuvm

Thanks.

We have added the generated column support in mysql_fdw after your request. Can you please check if that is useful for you and share your feedback? If you are happy with the latest addition, then can you please close the case from your end?

surajkharage19 avatar Aug 05 '22 02:08 surajkharage19