Why this matters
The `money` type's output depends on the server's `lc_monetary` locale setting, so the same row prints differently on different servers. The PostgreSQL recommendation is `numeric` plus a separate currency column.
Examples
Incorrect
CREATE TABLE t (price MONEY);Correct
CREATE TABLE t (price NUMERIC(10, 2), currency CHAR(3));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-money-type": "error",
},
},
]; Options
Edit the SQL — only no-money-type 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-money-type — plus no-syntax-error as a safety net.