[PostgreSQL 15] Improvements to UNIQUE and NULL in PostgreSQL 15

Original link: https://www.lifengdi.com/archives/transport/technology/3917

To sum up this improvement in one sentence: Support unique constraints and indexes treat null values ​​as the same value. Instead of indexing null values ​​into distinct values, you can now treat null values ​​as the same value by creating a constraint using unique nulls not distinct. Create an example table in two unique styles: CREATE TABLE null_old_style ( id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, val1 TEXT NOT NULL, val2 TEXT NULL, CONSTRAINT u […]

This article is reproduced from: https://www.lifengdi.com/archives/transport/technology/3917
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.