Example for Unique Partial Indexes

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: m(dot)matin(dot)agh(at)gmail(dot)com
Subject: Example for Unique Partial Indexes
Date: 2023-11-07 12:53:39
Message-ID: 169936161918.1769272.9365256195677055160@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/indexes-unique.html
Description:

I would like to request an improvement to the PostgreSQL documentation,
specifically in the sections "11.6. Unique Indexes" and "11.8. Partial
Indexes."

Currently, the documentation does not provide information on how to create
unique partial indexes. Unique partial indexes are valuable for enforcing
uniqueness of a column's value over a subset of a table.

To enhance the documentation's completeness and to provide a clear example
for users, I propose adding an entry in one of these sections with an
example as follows:

```sql
Copy code
-- Example of Creating a Unique Partial Index
-- This index enforces uniqueness of the 'column' over a subset of the
table
CREATE UNIQUE INDEX name ON table (column [, ...]) WHERE (condition);
This addition will assist users in understanding how to create unique
partial indexes and help them enforce uniqueness over specific subsets of
their tables. Please consider incorporating this addition into the
documentation.
```

Thank you for your attention to this request, and I believe it will
contribute to the clarity and comprehensiveness of the PostgreSQL
documentation.

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2023-11-07 16:48:51 Re: Example for Unique Partial Indexes
Previous Message Erki Eessaar 2023-11-07 10:12:21 An inconsistency in the documentation about full text search