Why this matters
Quoted mixed-case identifiers (`"UserAccounts"`) preserve their case and force every caller to quote them — a steady source of `relation does not exist` errors. Unquoted `CamelCase` is silently lowercased by PostgreSQL and passes the rule.
Examples
Incorrect
CREATE TABLE "UserAccounts" (id INT PRIMARY KEY);Correct
CREATE TABLE user_accounts (id INT PRIMARY KEY);CREATE TABLE UserAccounts (id INT PRIMARY KEY); -- folded to useraccountsConfigure it
// eslint.config.js
import postgresql from "eslint-plugin-postgresql";
export default [
{
files: ["**/*.sql"],
languageOptions: {
parser: postgresql.configs.recommended.languageOptions.parser,
},
plugins: { postgresql },
rules: {
"postgresql/snake-case-table-name": [
"warn",
{
allow: [],
},
],
},
},
]; Options
Edit the SQL — only snake-case-table-name is enabled.
Pre-filled with the first incorrect example. Toggle off in the rule shelf to see how the diagnostic disappears.
Diagnostics
No issues found.
2 rules enabled.
Rule under test
snake-case-table-name — plus no-syntax-error as a safety net.