关于在TDengine数据库中创建大写数据库名称或table名称的问题
question about creating upper case database name or table name in TDengine database
在 TDengine shell 中,任何大写字母都会自动转换为小写字母,如下所示:
taos> create database TEST;
Query OK, 0 of 0 row(s) in database (0.002404s)
taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status |
====================================================================================================================================================================================================================================================================================
test | 2021-11-16 16:07:47.410 | 0 | 0 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready |
db | 2021-11-16 13:30:46.858 | 13 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready |
Query OK, 2 row(s) in set (0.001591s)
taos> use test;
Database changed.
taos> create table STB(ts timestamp, c1 int) tags(t1 int);
Query OK, 0 of 0 row(s) in database (0.002349s)
taos> show stables;
name | created_time | columns | tags | tables |
============================================================================================
stb | 2021-11-16 16:08:34.322 | 2 | 1 | 0 |
Query OK, 1 row(s) in set (0.001501s)
有什么方法可以创建数据库名称或 table 大写字母的名称吗?
TDengine 数据库不支持大写数据库名称,但 table 名称支持大写 SQL:
taos> create table `UPPER_CASE_TABLE_NAME` (ts timestamp, c1 int); Query OK, 0 of 0 row(s) in database (0.008671s)
taos> show tables;
table_name | created_time | columns | stable_name | uid | tid | vgId |
==========================================================================================================================================================
UPPER_CASE_TABLE_NAME | 2022-05-05 18:40:21.011 | 2 | | 40813871670686384 | 2 | 145 |
Query OK, 1 row(s) in set (0.007461s)
在 TDengine shell 中,任何大写字母都会自动转换为小写字母,如下所示:
taos> create database TEST;
Query OK, 0 of 0 row(s) in database (0.002404s)
taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status |
====================================================================================================================================================================================================================================================================================
test | 2021-11-16 16:07:47.410 | 0 | 0 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready |
db | 2021-11-16 13:30:46.858 | 13 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready |
Query OK, 2 row(s) in set (0.001591s)
taos> use test;
Database changed.
taos> create table STB(ts timestamp, c1 int) tags(t1 int);
Query OK, 0 of 0 row(s) in database (0.002349s)
taos> show stables;
name | created_time | columns | tags | tables |
============================================================================================
stb | 2021-11-16 16:08:34.322 | 2 | 1 | 0 |
Query OK, 1 row(s) in set (0.001501s)
有什么方法可以创建数据库名称或 table 大写字母的名称吗?
TDengine 数据库不支持大写数据库名称,但 table 名称支持大写 SQL:
taos> create table `UPPER_CASE_TABLE_NAME` (ts timestamp, c1 int); Query OK, 0 of 0 row(s) in database (0.008671s)
taos> show tables;
table_name | created_time | columns | stable_name | uid | tid | vgId |
==========================================================================================================================================================
UPPER_CASE_TABLE_NAME | 2022-05-05 18:40:21.011 | 2 | | 40813871670686384 | 2 | 145 |
Query OK, 1 row(s) in set (0.007461s)