All rules

Style

postgresql/no-unnecessary-quoted-identifier

Disallow `"..."` around identifiers that don't need quoting.

  • Type suggestion
  • Recommended off
  • Fixable yes

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

Incorrect
SELECT "id", "name" FROM "users" WHERE "active" = TRUE;

Correct

Correct
SELECT id, name FROM users WHERE active = TRUE;
Correct
SELECT "select" FROM users; -- reserved keyword: must stay quoted
Correct
SELECT "MyColumn" FROM "MyTable"; -- mixed case: must stay quoted

Configure 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

This rule has no options.

Try this rule

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.

0 errors 0 warnings parse 0ms · rules 0ms
Diagnostics

No issues found.

2 rules enabled.

Rule under test no-unnecessary-quoted-identifier — plus no-syntax-error as a safety net.
eslint-plugin-postgresql

An ESLint plugin that lints .sql files with real PostgreSQL grammar and a curated set of best-practice rules.

© 2026 eslint-plugin-postgresql contributors Built on libpg-query · PostgreSQL 17