Re: BUG #13442: ISBN doesn't always roundtrip with text
От | Peter Geoghegan |
---|---|
Тема | Re: BUG #13442: ISBN doesn't always roundtrip with text |
Дата | |
Msg-id | CAM3SWZTvh+g2-S1TzUBrbmNthanhFv4=8k3d-QjMd6Dzr8fo_Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #13442: ISBN doesn't always roundtrip with text (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
On Mon, Jun 15, 2015 at 10:26 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > I poked at this a little bit. I think the issue may be that this bit > at line 832 in isn.c: > > case ISBN: > memcpy(buf, "978", 3); > > supposes that all ISBNs should have prefix 978, whereas your example is > using prefix 979, which seems to be also valid according to code a few > lines above. I actually didn't realize that the ISBN type assumed the "bookland" country code, which is 978. That's terrible, and is really a distinct way that the type is broken (distinct from the range enforcement misfeature that I always go on about). I was planning on suggesting completely removing any enforcement of ISBN ranges by the ISBN type. We could then rely entirely on the check digit, which has virtually no disadvantage relative to "more complete" enforcement. But even that's not going to help here, because the ISBN output function doesn't show the country code or the check digit: postgres=# select '978-0-393-04002-9'::isbn; isbn --------------- 0-393-04002-X (1 row) -- Peter Geoghegan
В списке pgsql-bugs по дате отправления: