Why this matters
Quoting identifiers that don't require it (no reserved-word collision, no mixed case, no embedded characters) just adds noise. PostgreSQL folds bare identifiers to lower case but preserves quoted ones, so quoted identifiers also force every consumer to quote-match the name. Reserved words, mixed-case identifiers, and identifiers containing special characters are left alone.
Examples
Incorrect
SELECT "id", "name" FROM "users" WHERE "active" = TRUE;Correct
SELECT id, name FROM users WHERE active = TRUE;SELECT "select" FROM users; -- reserved keyword: must stay quotedSELECT "MyColumn" FROM "MyTable"; -- mixed case: must stay quotedConfigure 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/no-unnecessary-quoted-identifier": "warn",
},
},
]; Options
Edit the SQL — only no-unnecessary-quoted-identifier 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
no-unnecessary-quoted-identifier — plus no-syntax-error as a safety net.