Re: Validating problem in the isn contrib module

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Validating problem in the isn contrib module
Date: 2009-03-06 12:16:36
Message-ID: 87ljric0d7.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)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 can be 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 the end 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!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2009-03-06 13:29:55 Re: Additional DTrace Probes
Previous Message Zdenek Kotala 2009-03-06 12:09:10 [PATCH] Regression test fix for Czech locale