Re: Validating problem in the isn contrib module - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Validating problem in the isn contrib module
Date
Msg-id 87ljric0d7.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Validating problem in the isn contrib module  (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>)
List pgsql-hackers
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!


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: [PATCH] Regression test fix for Czech locale
Next
From: Zdenek Kotala
Date:
Subject: Re: Additional DTrace Probes