Postgres Identifier Checker
PostgreSQL folds unquoted identifiers to lower case, silently cuts every name to 63 bytes (NAMEDATALEN - 1) and refuses reserved keywords unless they are double-quoted. Mistakes surface later as a relation does not exist error for a mixed-case table, a NOTICE that an identifier will be truncated, two long names that collide after truncation, or a syntax error near a column called user or order. Paste table, column or schema-qualified names, one per line, and this checker shows exactly what PostgreSQL 18 stores: the folded name, the byte length, whether and where it is truncated without splitting a multibyte character, the keyword category from pg_get_keywords(), where the name needs quotes, the quote_ident() result and a safe snake_case alternative. A second panel predicts the names PostgreSQL generates for primary keys, unique constraints, indexes, foreign keys, CHECK, EXCLUDE and NOT NULL constraints and serial sequences, including how it shortens long table and column names to fit. Results were checked against PostgreSQL 18 on thousands of generated names. Everything runs in your browser.
Auto-generated constraint and index names
Do more than postgres identifier checker — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Enter one identifier per line exactly as you would type it in SQL, quoted or unquoted, optionally schema-qualified.
- Click Check to see the stored name, truncation, keyword status, quote_ident() output and duplicate warnings.
- To preview constraint and index names, enter a table name and its key columns and click Generate names.
Frequently asked questions
What is the maximum length of a PostgreSQL identifier?
63 bytes. PostgreSQL stores names in the name type, which is NAMEDATALEN (64) bytes including a terminating zero byte. Longer table, column, index or constraint names are truncated to 63 bytes with a NOTICE such as: identifier "..." will be truncated to "...". The limit is in bytes, so a name with accented or CJK characters in UTF-8 gets cut much earlier than 63 characters. PostgreSQL never splits a multibyte character. Changing the limit requires recompiling the server.
Why does PostgreSQL say relation does not exist when the table is there?
Usually because of case folding. CREATE TABLE "Users" with quotes creates a table named Users with a capital U. A later SELECT * FROM Users without quotes is folded to users and does not find it. Either always quote the name exactly or, better, use lower-case snake_case names that never need quotes. Some ORMs and GUI tools quote every identifier, which is how mixed-case tables usually get created.
How does PostgreSQL name constraints and indexes automatically?
It joins the table name, the column names and a label with underscores: orders_pkey, orders_email_key for UNIQUE, orders_customer_id_fkey, orders_amount_check, orders_created_at_idx for CREATE INDEX without a name, and orders_id_seq for serial columns. If the result exceeds 63 bytes it shortens the longer of the table and column parts first, and if the name is taken it appends a number. Chat2DB shows these generated names in its table editor and lets you rename them with AI help: download it at chat2db.ai/download or use app.chat2db.ai.
