Re: Error in Example - Mailing list pgsql-docs

From Erik Wienhold
Subject Re: Error in Example
Date
Msg-id 2000743697.23098.1693581412642@office.mailbox.org
Whole thread Raw
In response to Error in Example  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
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



pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: Error in Example
Next
From: PG Doc comments form
Date:
Subject: Clarification of deadlock possibilities in section 13.3.5. Advisory Locks