Skip to content

needless-quotes

SQLstyleno fixdefault: offsql/sqlfluff

Reports a quoted name that is a plain word, not reserved, and already in the case the dialect folds unquoted names to (upper case for ansi, lower case for postgres), so the quotes change nothing.

The quotes suggest that the name is special, but it is the same name without them. Quotes also make the name case sensitive in the code that follows, which hides a mistake when one use is quoted and another is not.

To fix, remove the quotes.

Reported
select "A", "a", "ab c", "SELECT", date, name, a as filter from t;
sql:
lint:
rules:
needless-quotes: warn # off (default), warn, error

Enabled by the presets: sql/sqlfluff.

Suppress one line with sudsy-disable-next-line needless-quotes in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
sqlfluff RF06 full