Re: BUG #13442: ISBN doesn't always roundtrip with text
От | Fabien COELHO |
---|---|
Тема | Re: BUG #13442: ISBN doesn't always roundtrip with text |
Дата | |
Msg-id | alpine.DEB.2.10.1506200900060.31742@sto обсуждение исходный текст |
Ответ на | Re: BUG #13442: ISBN doesn't always roundtrip with text (Fabien COELHO <coelho@cri.ensmp.fr>) |
Ответы |
Re: BUG #13442: ISBN doesn't always roundtrip with text
|
Список | pgsql-bugs |
>> I think this definitely indicates a bug: >> >> regression=# select '9791020902573'::isbn; >> isbn >> --------------- >> 10-209-0257-4 >> (1 row) > > Yes, indeed, this one is definitely a bug. Attached patch makes isn to distinguish when needed between ISBN and ISBN13. ISBN is the legacy ISBN10 number which is part of ISBN13, but not all ISBN13 numbers are ISBN. The initial version was confusing both types, leading to accept valid ISBN13 number as valid ISBN(10) number although they use the 979 prefix, hence the reported issues. The patch also adds some tests. There is no clear upgrade path from 1.0 to 2.0, as the ISBN "in" function is changed, as well as some casts. I'm not sure of a safe way to upgrade, because the initial version was accepting invalid ISBN which would now be rejected, thus some store data may be considered corrupted in a database. On the other hand, probably few people would use a legacy ISBN type and put ISBN13 number in them, hopefully? Hmmm... -- Fabien.
В списке pgsql-bugs по дате отправления: