Re: BUG #13442: ISBN doesn't always roundtrip with text

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: bz(at)mailinator(dot)com, PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text
Date: 2015-06-16 03:35:12
Message-ID: 598.1434425712@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
>>> I have a table containing ISBNs stored as the isbn type provided by the isn
>>> extension. In certain cases an ISBN in ISBN10 form is considered unequal to
>>> the same ISBN in ISBN13 form.

> So I would say there is no bug as the number are indeed different, or that
> I missed something.

I think this definitely indicates a bug:

regression=# select '9791020902573'::isbn;
isbn
---------------
10-209-0257-4
(1 row)

regression=# select '10-209-0257-4'::isbn;
isbn
---------------
1-02-090257-4
(1 row)

I don't mind if '9791020902573' gets converted to something canonical,
but surely the canonical value ought to reproduce without further change.

Furthermore,

regression=# select '9791020902573'::isbn = '10-209-0257-4'::isbn;
?column?
----------
f
(1 row)

so apparently the canonicalization conversion wasn't right to begin with.

I have no idea which of these forms should be considered valid or
canonical, but surely the two behaviors exhibited above are wrong.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabien COELHO 2015-06-16 05:37:21 Re: BUG #13442: ISBN doesn't always roundtrip with text
Previous Message Thomas Munro 2015-06-16 03:30:53 Re: BUG #13440: unaccent does not remove all diacritics