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.1506160958340.4491@sto
обсуждение исходный текст
Ответ на Re: BUG #13442: ISBN doesn't always roundtrip with text  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
>>  regression=# select '9791020902573'::isbn = '10-209-0257-4'::isbn;
>> f
>> beginning with 979 to a ISBN10 should have raised an exception.

> Making the second query return true makes the system internally consistent
> too...but doesn't actually provide the correct answer (again, I trust)

Yes.

On third thoughs, the above query should raise an exception because the
cast is illegal, 979* is not an ISBN, so the answer is neither true nor
false. The query should be simply written to use the larger type and not
cast to the subtype.

   SELECT EAN13 '9791234567896' = ISBN '123456789X'; -- False
   SELECT EAN13 '9781234567897' = ISBN '123456789X'; -- True

--
Fabien.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master
Следующее
От: 德哥
Дата:
Сообщение: Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect