---
title: "Identifiers"
description: "Rules for CoraDB identifiers: allowed characters, case-insensitivity, quoting with double quotes, brackets or backticks, and maximum lengths."
url: "https://www.coradb.ai/manual/sql/identifier.html"
markdown_url: "https://www.coradb.ai/manual/markdown/sql/identifier.md"
product: "CoraDB"
version: "1.0"
keywords: "coradb identifier, identifier rules, quoted identifier, reserved word as column name, case sensitivity, identifier length, table name rules, column name rules"
---

# Identifiers

Identifiers are the names you give to database objects: tables, vertex and edge tables, columns, indexes, constraints, views, serials, triggers, stored procedures and users.

## Rules for plain identifiers

A name written without quotes must follow these rules:

- It starts with a letter, an underscore (`_`) or a number sign (`#`). It cannot start with a digit.
- The other characters can be letters, digits, `_` and `#`.
- Letters can be any Unicode letters, not only `A`–`Z`: `preț_produs` is a valid name.
- It cannot contain spaces or operator characters (`+ - * / % || ! < > = | ^ & ~`).
- It cannot be a [reserved word](https://www.coradb.ai/manual/sql/keyword.html).

```text
identifier       ::= first_character [ other_character ... ]
first_character  ::= letter | _ | #
other_character  ::= letter | digit | _ | #
```

Valid names:

```text
order_items
ssn#
_staging
#tmp_orders
preț_produs
```

Invalid names, unless quoted:

```text
2fer          -- starts with a digit
low cost      -- contains a space
price+tax     -- contains an operator character
order         -- reserved word
```

Using a reserved word as a plain name is a syntax error:

```sql
SELECT order FROM orders;
```

```text
ERROR: Syntax error: unexpected 'order'
```

## Case-insensitivity

Identifiers are not case-sensitive: `Mixed_Case`, `mixed_case` and `MIXED_CASE` are the same table. CoraDB stores and displays names in lowercase. This also applies to quoted names.

## Quoted identifiers

Enclose a name in double quotes (`"`), square brackets (`[ ]`) or backticks (`` ` ``) to use a name that the rules above would not allow, such as a reserved word, a name with spaces or a name starting with another symbol. The three forms are interchangeable:

```sql
CREATE TABLE "low cost" ("select" INT, [position] INT, `order` INT, "@lowcost" INT);
INSERT INTO "low cost" VALUES (1, 2, 3, 4);

SELECT "select", [position], `order`, "@lowcost" FROM [low cost];
```

| select | position | order | @lowcost |
|---:|---:|---:|---:|
| 1 | 2 | 3 | 4 |

A reserved word used as a column name does not need quotes when it is qualified with the table name or alias:

```sql
SELECT t.select, t.position FROM "low cost" t;
```

You also need quotes for names that contain a hyphen, such as the database name in the result column of [SHOW TABLES](https://www.coradb.ai/manual/sql/query/show.html#show-tables) on the e-commerce database: `[Tables_in_e-commerce]`.

> **Note:**
> Double quotes delimit identifiers only while the [ansi_quotes](https://www.coradb.ai/manual/admin/config_sql.html#statementtype-related-parameters) parameter is `yes` (the default). When it is set to `no` in `coradb.conf`, text in double quotes is a character string, as in single quotes; use brackets or backticks for identifiers then. The parameter cannot be changed with `SET SYSTEM PARAMETERS`.


Quoting identifiers that do not need it is harmless, but quoted names are harder to read and type. Prefer plain names in `snake_case` that avoid reserved words.

## Maximum length

The maximum length of a name is counted in bytes, not characters. In UTF-8, letters outside the ASCII range take 2 to 4 bytes, so a name made of such letters can hold fewer characters.

| Object | Maximum length |
|---|---|
| Database | 17 bytes |
| Table, vertex table, edge table, view | 254 bytes |
| Column | 254 bytes |
| Index, constraint | 254 bytes |
| Serial | 254 bytes |
| Trigger | 254 bytes |
| Java stored procedure | 254 bytes |

> **Warning:**
> A longer table name is not rejected: CoraDB shortens it to 254 bytes. Keep names well below the limit.


The names CoraDB generates for constraints, such as `pk_<table>_<column>` for a primary key or `fk_<table>_<column>` for a foreign key, are subject to the same limit. With long table and column names, give such constraints an explicit, shorter name.

## See also

- [Reserved words](https://www.coradb.ai/manual/sql/keyword.html)
- [Literals](https://www.coradb.ai/manual/sql/literal.html)
- [Comments](https://www.coradb.ai/manual/sql/comment.html)
