Copying data to tables with . in the name
I am having trouble copying data from one database to another using the COPY FROM VERTICA command. It works fine when the table doesn't have a '.' in the name, unfortunately a lot of ours do
For example, do this on the source database:
Thanks
Kevin
For example, do this on the source database:
CREATE TABLE farm."good_table" (Then switch to the destination database and do the following:
stuff int
);
CREATE TABLE farm."evil.table" (
stuff int
);
insert into farm."good_table" values (1);
insert into farm."good_table" values (2);
insert into farm."good_table" values (3);
insert into farm."evil.table" values (1);
insert into farm."evil.table" values (2);
insert into farm."evil.table" values (3);
commit;
CREATE TABLE farm."good_table" (Everything works fine, but then do this:
stuff int
);
CREATE TABLE farm."evil.table" (
stuff int
);
CONNECT TO VERTICA pgvert1 USER ********** PASSWORD ************ ON *************,*********;
COPY farm."good_table" FROM VERTICA pgvert1.farm."good_table";
COPY farm."evil_table" FROM VERTICA pgvert1.farm."evil_table";And you get the error:
ERROR 4568: Relation "farm.evil_table" does not existIs there anyway around this?
Thanks
Kevin
0
Comments
COPY pgvert1.farm."evil.table" FROM VERTICA pgvert1.farm."evil.table";
I understand that many of your tables have a period in the name itself like evil.table and it works in most of the commands like SELECT, regular COPY etc. as long as you enclose in quotes as you have done above.
A possible work-around for the COPY FROM to work is: -
a. Rename the source table to evil_table
b. Run the COPY FROM evil_table
c. Rename it back to evil.table
If I find more solid information on the root cause, will post it here again.