Re: Default ordering option

Поиск
Список
Период
Сортировка
Искать
От
Julien Rouhaud
Тема
Re: Default ordering option
Дата
Msg-id
CAOBaU_bEuhPcv-aCaQBz3V+6k8PzG8_fV70-TYFGy1X1PjZsdg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Default ordering option Cyril Champier <cyril.champier@doctolib.com>
Re: Default ordering option Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: Default ordering option Cyril Champier <cyril.champier@doctolib.com>
Re: Default ordering option Adrian Klaver <adrian.klaver@aklaver.com>
Re: Default ordering option Cyril Champier <cyril.champier@doctolib.com>
Re: Default ordering option "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: Default ordering option Julien Rouhaud <rjuju123@gmail.com>
Re: Default ordering option Cyril Champier <cyril.champier@doctolib.com>
Re: Default ordering option Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: Default ordering option Cyril Champier <cyril.champier@doctolib.com>
Re: Default ordering option Adrian Klaver <adrian.klaver@aklaver.com>
Re: Default ordering option Ian Barwick <ian.barwick@2ndquadrant.com>
Re: Default ordering option Cyril Champier <cyril.champier@doctolib.com>
Re: Default ordering option Adrian Klaver <adrian.klaver@aklaver.com>
Re: Default ordering option Cyril Champier <cyril.champier@doctolib.com>
Re: Default ordering option Adrian Klaver <adrian.klaver@aklaver.com>
On Fri, Jul 26, 2019 at 9:53 AM Cyril Champier
 wrote:
>
> Adrian:
>
>> Are you really looking for a pseudo-random name?
>
>
> No, the code I pasted was an existing production bug: the last_name should have been unique, so the selected patient would always be the same.
> This should have been detected in tests, but since the order was "almost always the same", our test was green 99% of the time, so we discarded it as flaky.

If the filter should return at most 1 row, why put a LIMIT in the
first place?  Even with a forced random() you won't get a failure
every time, while asserting there's at most 1 row returned is
guaranteed to fail?


В списке pgsql-general по дате отправления
От: Luca Ferrari
Дата:
От: Cyril Champier
Дата:
Сообщение: Re: Default ordering option
FAQ