Re: Validating problem in the isn contrib module

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Germán Méndez Bravo <kronuz(at)hotmail(dot)com>
Subject: Re: Validating problem in the isn contrib module
Date: 2009-03-05 23:32:40
Message-ID: C12AE0A2A752416C79F3EE81@teje
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--On Freitag, März 06, 2009 02:26:12 +0100 Andreas 'ads' Scherbaum
<adsmail(at)wars-nicht(dot)de> wrote:

> test=# select is_valid('978-3-937514-69-6'::isbn13);
> ERROR: invalid check digit for ISBN number: "978-3-937514-69-6",
> should be 7 ROW 1: select is_valid('978-3-937514-69-6'::isbn13);

According to the docs, this is intended behavior. If you want to validate
those values later or yourself, you have to use the weak mode:

#= SELECT isn_weak(true);
isn_weak
----------
t

#= SELECT is_valid('978-3-937514-69-6'::isbn13);
is_valid
----------
f

#= SELECT is_valid('978-3-937514-69-7'::isbn13);
is_valid
----------
t

--
Thanks

Bernd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-03-05 23:35:24 Re: GIN, partial matches, lossy bitmaps
Previous Message Joshua Tolley 2009-03-05 21:43:43 Re: Make SIGHUP less painful if pg_hba.conf is not readable