【问题标题】:How to determine the currently selected database in clickhouseclickhouse中如何判断当前选中的数据库
【发布时间】:2020-08-08 16:28:23
【问题描述】:

您如何找到上次使用 clickhouse 中的 use <database> 命令选择的数据表(即您当前的数据库名称)?

【问题讨论】:

    标签: command-line-interface clickhouse


    【解决方案1】:

    需要使用currentDatabase-function:

    SELECT currentDatabase()
    /*
    ┌─currentDatabase()─┐
    │ default           │
    └───────────────────┘
    */
    
    use system;
    
    SELECT currentDatabase()
    /*
    ┌─currentDatabase()─┐
    │ system            │
    └───────────────────┘
    */
    

    此功能存在一些问题:

    #6104: currentDatabase() + create table ON CLUSTER DDL

    issues in github ..

    【讨论】:

      猜你喜欢
      • 2015-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-08
      • 2019-01-31
      • 1970-01-01
      • 2015-08-07
      • 1970-01-01
      相关资源
      最近更新 更多