Andreas 'ads' Scherbaum <adsmail@wars-nicht.de> writes:
> So this function is useless. If the syntax is valid, the check is
> already done and is_valid() returns true. If the syntax is invalid, PG
> will raise an error even before this function returns. The invalid
> marker is not checked at all.
This seems pretty clearly explained in the documentation.
When you insert invalid numbers in a table using the weak mode, the number will be inserted with the corrected check
digit,but it will be displayed with an exclamation mark (!) at the end, for example 0-11-000322-5!. This invalid marker
canbe checked with the is_valid function and cleared with the make_valid function.
You can also force the insertion of invalid numbers even when not in the weak mode, by appending the ! character at
theend of the number.
> This leads back to my initial question: intended behaviour or just a
> bug? And how can one validate an ISBN without raising an error?
-- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!