Move a table from one schema to another

panayichr
Padawan

Is there any way that I can easily move a table from one Exasol Schema to another in the same server? 

I want to avoid creating the table to another schema and copy there, since is a big table.

2 ACCEPTED SOLUTIONS

skarangi
SQL-Fighter

Hi,

 

This might be a very dumb idea but instead of moving a mountain, can we move stones around it ? I mean move other tables around it to other schema and rename the schema. 

 

regards,
Sreekanth

View solution in original post

mwellbro
Xpert

Hi panayichr,

since RENAME does not allow to move tables accross schemas I think you´ll have to copy the table - I at least don´t know of any other way to shift it from one schema to another.

It´s probably either CTAS if you have the space "on hand" or EXPORT/DROP/IMPORT if you haven´t and can afford to take the table "offline" for a bit.

Cheers,
Malte

View solution in original post

4 REPLIES 4

mwellbro
Xpert

Hi panayichr,

since RENAME does not allow to move tables accross schemas I think you´ll have to copy the table - I at least don´t know of any other way to shift it from one schema to another.

It´s probably either CTAS if you have the space "on hand" or EXPORT/DROP/IMPORT if you haven´t and can afford to take the table "offline" for a bit.

Cheers,
Malte

View solution in original post

panayichr
Padawan

Hi Malte,

Thanks for reply. I guess I will have to copy the data from one table to another. 

skarangi
SQL-Fighter

Hi,

 

This might be a very dumb idea but instead of moving a mountain, can we move stones around it ? I mean move other tables around it to other schema and rename the schema. 

 

regards,
Sreekanth

View solution in original post

panayichr
Padawan

Hello Sreekanth,

Actually that's a clever solution. But in my case I cannot do that since in the destination schema I have another "mountain" table.

But thanks for the solution!