content/shared/influxdb3-reference/naming-restrictions.md
InfluxDB 3 has specific naming restrictions and conventions that apply to databases, tables, tags, fields, and other identifiers. Understanding these restrictions helps ensure your data model works correctly with all query languages and avoids naming conflicts.
Database names must follow these restrictions:
_), dash (-), and forward-slash (/)_)Valid database names:
mydb
sensor_data
prod-metrics
logs/application
webserver123
Invalid database names:
my database # Contains whitespace
sensor.data # Contains period
app@server # Contains special character
_internal # Starts with underscore (not recommended)
very_long_database_name_that_exceeds_sixty_four_character_limit # Too long
Table names in {{% product-name %}} follow line protocol measurement naming rules:
_), dash (-)_)Valid table names:
temperature
cpu_usage
http-requests
sensor123
웹서버_메트릭스 # UTF-8 characters
Names requiring quotes in queries:
"my table" # Contains whitespace
"cpu.usage" # Contains period
"http@requests" # Contains special character
Invalid table names:
_internal # Starts with underscore (not recommended)
Tag keys and field keys follow these restrictions:
_), dash (-)_)Valid tag and field keys:
host
region
temperature
cpu_usage
http-status
sensor123
Keys requiring quotes in queries:
"host name" # Contains whitespace
"cpu.usage" # Contains period
"http@status" # Contains special character
Invalid tag and field keys:
_internal # Starts with underscore (not recommended)
Tag and field values have different restrictions:
Different query languages have additional naming requirements:
When using SQL to query {{% product-name %}}:
") for names with special characters, whitespace, or to preserve caseWhen using InfluxQL to query {{% product-name %}}:
") for names with special characters or whitespaceThe following prefixes may be reserved for system use:
_ (underscore): May be reserved for system databases, measurements, and field keysiox_: Reserved for InfluxDB internal metadata[!Caution]
Using underscore-prefixed names
While InfluxDB might not explicitly reject names starting with underscore (
_), using them risks conflicts with current or future system features and may result in unexpected behavior or data loss.
Avoid using these common reserved keywords as identifiers without quoting:
SQL keywords (partial list):
SELECT, FROM, WHERE, GROUP, ORDER, BYCREATE, DROP, ALTER, INSERT, UPDATE, DELETETABLE, DATABASE, INDEX, VIEWTIME, TIMESTAMP, INTERVALInfluxQL keywords (partial list):
SELECT, FROM, WHERE, GROUP, ORDER, BYSHOW, DROP, CREATE, DELETEMEASUREMENT, TAG, FIELD, TIMELIMIT, OFFSET, SLIMIT, SOFFSETFor complete lists, see:
cpu_usage over cpu-usage or cpuUsage# Database naming
prod-metrics
dev-logs
sensor-data
# Table naming
cpu_usage
memory_utilization
http_requests
disk_io
# Tag keys
host
region
service
environment
# Field keys
value
count
duration_ms
bytes_sent
When identifiers contain special characters, whitespace, or reserved keywords, they must be quoted in queries:
-- Quoted database and table names
SELECT * FROM "my-database"."my table";
-- Quoted column names
SELECT "cpu usage", "memory.available" FROM metrics;
-- Reserved keyword as identifier
SELECT "group" FROM "user-data";
-- Quoted measurement name
SELECT * FROM "http requests";
-- Quoted tag key with special characters
SELECT * FROM metrics WHERE "host.name" = 'server01';
-- Reserved keyword as field
SELECT "time" FROM "system-metrics";