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

From: bz(at)mailinator(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13442: ISBN doesn't always roundtrip with text
Date: 2015-06-14 15:59:12
Message-ID: 20150614155912.2732.93270@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13442
Logged by: B.Z
Email address: bz(at)mailinator(dot)com
PostgreSQL version: 9.4.4
Operating system: Linux think 4.0.0-1-amd64 #1 SMP Debian 4.0.2-1 (2
Description:

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.

Assuming the isn extension is installed:

CREATE TEMP TABLE t(i isbn);
INSERT INTO t VALUES('9791020902573');
SELECT * FROM t WHERE i = '9791020902573'; -- Returns 10-209-0257-4
SELECT * FROM t WHERE i = '10-209-0257-4'; -- Returns 0 rows
SELECT '9791020902573'::isbn = '10-209-0257-4'::isbn; -- Returns f

Other examples of ISBNs with this behavior:

select isbn from isbns where isbn::isbn != isbn::isbn::text::isbn;
isbn
10-91986-01-0
10-91414-02-5
975891300-X
598687008-5
904072556-X
10-209-0257-4
10-209-0014-8
960838204-1
10-91447-03-9
963208937-5
10-209-0011-3
975297291-8
957849470-X
157607283-5
10-93509-00-7
10-209-0014-8
10-209-0273-6
975574374-X
979984511-4
953173635-9
853390230-1
963930301-1
10-223-0179-9
10-209-0141-1
10-209-0041-5
960218202-4
598340069-X
10-91600-01-5
598340069-X
(29 rows)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-06-14 17:59:18 Re: BUG #13440: unaccent does not remove all diacritics
Previous Message digoal 2015-06-14 09:26:06 BUG #13441: pg_settings.pending_restart cann't reflect changed setting in configure file.