Why this matters
Listing columns explicitly keeps the result schema stable when the table evolves — a new column won't silently appear in callers, and a removed column won't silently disappear. The aggregate form `count(*)` is unaffected.
Examples
Incorrect
SELECT * FROM users;SELECT u.* FROM users u;Correct
SELECT id, name FROM users;SELECT count(*) FROM users; -- aggregate star is fineConfigure 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-select-star": "warn",
},
},
]; Options
Edit the SQL — only no-select-star 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-select-star — plus no-syntax-error as a safety net.