How to list all schemas and switch to one in ClickHouse

72 Views Asked by At

I'm new to ClickHouse and I'm trying to use the CLI client. What's the Clickhouse way to select all schemas and then select one? I mean the equivalent of Oracle's

select username from sys.all_users
alter session set current_schema = otheruser;

Or Postgres's

\list
set search_path to 'schema_name'

Thank you!

1

There are 1 best solutions below

0
Mig82 On

Ok, after a bit of searching I found the answer.

show databases
SELECT currentDatabase()

This helps you see where you are and what are all the databases (schemas) you can go to. Then...

use database_name

Allows you to select the one you want to work with.