Navigation Menu

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

How to remove a table from the list of available tables in MaterializedPostgreSQL? #33800

Closed
Olga-par opened this issue Jan 19, 2022 · 6 comments · Fixed by #35158
Closed

How to remove a table from the list of available tables in MaterializedPostgreSQL? #33800

Olga-par opened this issue Jan 19, 2022 · 6 comments · Fixed by #35158
Assignees

Comments

@Olga-par
Copy link

Hello.

I have some problem with removing tables from MaterializedPostgreSQL.
I ran command:
detach table <name_table> PERMANENTLY;
When I performed select * from <name_table> than it's ok. The message appears: Table <name_table> doesn't exist.
But when i view the list of tables in dbeaver in replicated database i see this table.
I need recreate MaterializedPostgreSQL database without this table in order to not view this table in this database?

@Olga-par Olga-par added the question Question? label Jan 19, 2022
@kssenii
Copy link
Member

kssenii commented Jan 19, 2022

But when i view the list of tables in dbeaver in replicated database i see this table.

you mean SHOW TABLES query?

@kssenii kssenii self-assigned this Jan 19, 2022
@Olga-par
Copy link
Author

Yes

@Olga-par
Copy link
Author

And when I want to return this table with command: attach table <name_atable> then appears message: Table <name_atable> already exists.

@kssenii
Copy link
Member

kssenii commented Jan 19, 2022

you mean SHOW TABLES query?

I have the test which checks exatly what you told https://github.com/ClickHouse/ClickHouse/blob/master/tests/integration/test_postgresql_replica_database_engine_2/test.py#L136-L141

@kssenii
Copy link
Member

kssenii commented Jan 19, 2022

It does not work because you added PERMANENTLY. In order to remove table from replication from Postgres and to remove it from ch you need to do just DETACH, no PERMANENTLY (it will anyway be permanently removed)

@Olga-par
Copy link
Author

And when I want to return this table with command: attach table <name_atable> then appears message: Table <name_atable> already exists. - this problem appears when i made simple detach <name_atable> without PERMANENTLY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants