mysql_fdw
mysql_fdw copied to clipboard
Support Truncate like postgres_fdw of postgresql-14
Currently, we already implement Truncate like postgres_fdw from postgresql-14. I would like to contribute them into repository and community. If you have interest? I will create pull request for share this feature.
Summary modification:
- Only support the basic truncate statement TRUNCATE [TABLE] tbl_name.
- Add function: mysql_deparse_truncate_sql()
- Add foreign routine: mysqlExecForeignTruncate()
Reference testcase of postgres_fdw.sql in postgres_fdw:
-- Before
ALTER SERVER mysql_svr OPTIONS (ADD truncatable 'false');
TRUNCATE tru_ftable; -- error
ERROR: foreign table "tru_ftable" does not allow truncates
-- After
ALTER FOREIGN TABLE tru_ftable OPTIONS (ADD truncatable 'true');
TRUNCATE tru_ftable;
Thanks.
We have added the truncate 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?