Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Oracle] Issue in importing data of tables having reserved keyword of datatype as table names in Oracle #1505

Open
priyanshi-yb opened this issue May 10, 2024 · 0 comments
Labels
triage Needs to be triaged

Comments

@priyanshi-yb
Copy link
Contributor

priyanshi-yb commented May 10, 2024

If there is a table having a name as a reserved keyword of datatype in Oracle. There is an issue in dumping the incorrect data dump for that table and importing that exported data in target might fail with syntax errors.

Workaround: Modify the data to correct syntax as per the datatype exported for that table.

Example

An example schema on the source database is as follows:

create table "number"(id int PRIMARY KEY);
insert into "number" values(0);
insert into "number" values(1);
insert into "number" values(2);
insert into "number" values(3);
insert into "number" values(4);

The exported schema and data are as follows:

create table "number"(
	id numeric(38) NOT NULL,
	PRIMARY KEY (id)
);

COPY number (id) FROM STDIN;
f
t
2
3
4
\.

Error when import the data is as follows:

ERROR: invalid input syntax for type numeric: "t" (SQLSTATE 22P02), COPY number, line 1, column id: "t" 

Workaround for the example is to modify the data to change the f/t to 0/1 respectively:

COPY number (id) FROM STDIN;
0
1
2
3
4
\.
@github-actions github-actions bot added the triage Needs to be triaged label May 10, 2024
@priyanshi-yb priyanshi-yb changed the title [Oracle] Issue in importing data of tables having reserved word names as datatypes in Oracle [Oracle] Issue in importing data of tables having reserved keyword of datatype as table names in Oracle May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant