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

support moving tables between tablespaces #172

Open
kreopt opened this issue Oct 18, 2023 · 1 comment
Open

support moving tables between tablespaces #172

kreopt opened this issue Oct 18, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@kreopt
Copy link

kreopt commented Oct 18, 2023

What's wrong?

H! We have two separate tablespaces: default(ssd with relatively small capacity for current data) and hdd (high capacity, historical data) and don't want to store columnar tables on ssd. But there is an error on moving columnar table:

alter table fact_events_1_2021 set tablespace hdd;
ОШИБКА:  columnar_relation_copy_data not implemented

Is there a way to move this data or some plans to implement this feature?

@kreopt kreopt added the bug Something isn't working label Oct 18, 2023
@wuputah
Copy link
Member

wuputah commented Oct 18, 2023

Thanks for the report. I believe tablespaces themselves should work but moving tables isn't supported yet.

The best I can suggest is to copy the table like so:

-- copy table to a new table
create table fact_events_1_2021_hdd (like fact_events_1_2021) using columnar tablespace hdd;
insert into fact_events_1_2021_copy select * from fact_events_1_2021;
-- swap the two table names
alter table fact_events_1_2021 rename to fact_events_1_2021_ssd;
alter table fact_events_1_2021_hdd rename to fact_events_1_2021;
-- when you are ready, drop the old table on the ssd.
drop table fact_events_1_2021_ssd;

@wuputah wuputah changed the title [Bug]: moving columnar table to tablespace is not supported support moving tables between tablespaces Oct 18, 2023
@wuputah wuputah added enhancement New feature or request and removed bug Something isn't working labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants