vsql_luhn checks that digit and generates it, so a
CHECK constraint can refuse a bad number before it reaches a row.
A third party writes and maintains this extension. VillageSQL does not build,
test, or ship it, and the description below follows the maintainer’s own
documentation. Read that documentation before you rely on it.
Install
Build it from the repository, then install it into the server:What it adds
Because
luhn_valid answers 0 instead of failing on text that is not a number,
it drops straight into a WHERE clause over a column of unvalidated input.
See also
- Available extensions — the full catalog
- intojhanurag/vsql-luhn — source, examples, and the known limitations

