0

I have some table in mariadb.

I need to create foreign table partition for that table

CREATE  TABLE IF NOT EXISTS users (  
  id serial NOT NULL, 
  name varchar(30)
) partition by range(id);

CREATE foreign TABLE IF NOT EXISTS users_p 
  partition of users for values from(0) to (10000) 
SERVER test22 
options (table_name 'users');

If i try to get some data all is OK

but then i try insert something

insert into users (id,name) values (111,'somename');

I got an error (text depends on fdw)

COPY and foreign partition routing not supported in mysql_fdw

i tried two variants of fdw.

EnterpriseDB/mysql_fdw and pgspider/jdbc_fdw

Is there a fdw that supports insert if foreign table is partition? Or any variants how can i realize that

vantaqada
  • 101
  • 2
  • 6
  • Changed the postgres-fdw tag to mysql-fdw to match what is reported in the question. – Adrian Klaver Mar 30 '22 at 21:14
  • 1
    You might want to add a comment to this issue [Partition INSERT](https://github.com/EnterpriseDB/mysql_fdw/issues/250). – Adrian Klaver Mar 30 '22 at 21:26
  • This post says that foreign keys are not allowed on partitioned tables in mysql. Is it the same in mariaDB? https://stackoverflow.com/questions/1537219/how-to-handle-foreign-key-while-partitioning –  Mar 31 '22 at 10:27

1 Answers1

0

pgspider/mysql_fdw - solves my problem

vantaqada
  • 101
  • 2
  • 6