Re: Proposal: Add a UNIQUE NOT ENFORCED constraint
| От | Joel Jacobson |
|---|---|
| Тема | Re: Proposal: Add a UNIQUE NOT ENFORCED constraint |
| Дата | |
| Msg-id | adbac78c-1aa0-4301-b8a8-6f79064d567b@app.fastmail.com обсуждение исходный текст |
| Ответ на | Proposal: Add a UNIQUE NOT ENFORCED constraint (Jacob Jackson <jej.jackson.08@gmail.com>) |
| Ответы |
Re: Proposal: Add a UNIQUE NOT ENFORCED constraint
|
| Список | pgsql-hackers |
On Sun, Jan 4, 2026, at 18:34, Jacob Jackson wrote: > I am working through a case that requires very high throughput inserts > that would be slowed down by a unique index, but that has externally > guaranteed unique values and could benefit from the query planning and > documentation provided by a unique constraint. > > To fill this need, I propose adding a UNIQUE NOT ENFORCED constraint, > which would tell Postgres to assume uniqueness without creating a > unique index to enforce it, leaving ensuring uniqueness to the > developer, similar to unenforced CHECK and foreign key constraints > (https://commitfest.postgresql.org/patch/5285/). Can you please share some more details on your use-case? I'm curious to learn more about this "unique" column. Don't you ever need to do lookups/joins on it (e.g. WHERE col = ?)? /Joel
В списке pgsql-hackers по дате отправления: