pgschema
pgschema copied to clipboard
`pgschema dump` drops `NULLS NOT DISTINCT` from `UNIQUE` table constraints
Given the following schema with a table-level UNIQUE constraint using the NULLS NOT DISTINCT modifier:
CREATE TABLE pgschema_repro_nulls (
a integer,
b integer,
CONSTRAINT pgschema_repro_nulls_uniq UNIQUE NULLS NOT DISTINCT (a, b)
);
pgschema dump silently drops the modifier by returning the following DDL:
CREATE TABLE IF NOT EXISTS pgschema_repro_nulls (
a integer,
b integer,
CONSTRAINT pgschema_repro_nulls_uniq UNIQUE (a, b)
);
The same modifier seems to be preserved correctly on standalone CREATE UNIQUE INDEX ... NULLS NOT DISTINCT (see #355).
(NULLS NOT DISTINCT was introduced in PostgreSQL 15).