mysql_fdw icon indicating copy to clipboard operation
mysql_fdw copied to clipboard

Support RETURNING on mariadb > 10.5

Open wpichler opened this issue 3 years ago • 3 comments

Hi all,

MariaDB > 10.5 does support RETURNING now.

https://mariadb.com/kb/en/insertreturning/

I'd like to add this feature to mysql_fdw - but without knowing the fdw sources / postgres internals it is hard to handle.

This is Work in Progress - maybe someone has already done this - also working on it ?

Currently i do get a cache lookup error on the columns translate - i think i am using it not correct.

wpichler avatar Nov 21 '22 06:11 wpichler

Thanks for the pull request.

As you mentioned above, RETURNING clause might be working in MariaDB >10.5 but not in MySQL. So the changes will be complicated even if we try to implement only for MariaDB as mysql_fdw supports both. Currently, this is not on our roadmap but if you have a working patch ready for the same, we will be happy to review and take it further. From the pull request that you submitted, I can see code changes but I don't think those are considered for MySQL as well.

surajkharage19 avatar Nov 21 '22 09:11 surajkharage19

The current PR is just a starting point - far from complete. For the real implementation i would implement a query to get the server type (mysql / mariadb) and version. And depending on the version the returning is then available or not.

wpichler avatar Nov 21 '22 09:11 wpichler

@wpichler , there is version functions and full RETURNING support in firebird_fdw. You can read the interesting realisation from @ibarwick.

mkgrgis avatar Feb 14 '23 11:02 mkgrgis