[MySQL] Import data fails while migrating the table with name same as system table in target
priyanshi-yb opened this issue · 0 comments
priyanshi-yb commented
Import data fails while migrating the table with name same as system table as datafile has that name only and all other places that name is with quotes.
ex- user
table is the system table in the PG/YB for storing user info and hence cann't be used table_name.
Example on MySQL:
Source schema -
create table user(id int, col text);
insert into user values(1,'Test');
insert into user values(2,'Test');
insert into user values(3,'Test');
insert into user values(4,'Test');
Export schema in table.sql -
CREATE TABLE "user" (
id bigint,
col text
) ;
Exported data in datafile which is named as - user_data.sql
, as can be seen the table_name in the content of the file is also with quotes.
SET client_encoding TO 'UTF8';
COPY "user" (id,col) FROM STDIN;
1 Test
2 Test
3 Test
4 Test
\.
Import schema went fine but import data fails with message-
Following tables are not empty. TRUNCATE them before importing data with --start-clean.
user