Error in Example

Started by PG Bug reporting formover 2 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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.

#2Erik Wienhold
ewie@ewie.name
In reply to: PG Bug reporting form (#1)
Re: Error in Example

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