Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4TTt-00014Z-CS for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Jun 2015 12:27:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z4TTs-0002VT-Sq for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Jun 2015 12:27:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z4AKN-0006x5-2p for pgsql-bugs@postgresql.org; Sun, 14 Jun 2015 16:00:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Z4AKJ-0007Id-Jd for pgsql-bugs@postgresql.org; Sun, 14 Jun 2015 16:00:05 +0000 MIME-Version: 1.0 Subject: BUG #13442: ISBN doesn't always roundtrip with text To: pgsql-bugs@postgresql.org From: bz@mailinator.com Date: Sun, 14 Jun 2015 15:59:12 +0000 Message-ID: <20150614155912.2732.93270@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 13442 Logged by: B.Z Email address: bz@mailinator.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) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs