Обсуждение: Error in Example

Поиск
Список
Период
Сортировка

Error in Example

От
PG Doc comments form
Дата:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/indexes-partial.html
Description:

The IP addresses used to exemplify which one will be covered by the partial
index are inverted.

Re: Error in Example

От
Erik Wienhold
Дата:
On 31/08/2023 01:29 CEST PG Doc comments form <noreply@postgresql.org> wrote:

> Page: https://www.postgresql.org/docs/15/indexes-partial.html
> Description:
>
> The IP addresses used to exemplify which one will be covered by the partial
> index are inverted.

No, the example is correct.  It's about only indexing addresses outside some
hypothetical organization's subnet 192.168.100.0/24.  Notice that the index
predicate is negated.

Of course the predicate could be written without inverting the range:

    WHERE (client_ip <= inet '192.168.100.0' OR
               client_ip >= inet '192.168.100.255')

--
Erik