Skip to content

Commit 452a5d1

Browse files
committed
exclude partial indexes from unique index check
1 parent f75d7af commit 452a5d1

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

sql/load_sql_context.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ select
280280
),
281281
array[]::text[]
282282
),
283-
'is_unique', pi.indisunique,
283+
'is_unique', pi.indisunique and pi.indpred is null,
284284
'is_primary_key', pi.indisprimary
285285
)
286286
)

test/expected/issue_542_partial_unique.out

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -79,37 +79,37 @@ begin;
7979
}
8080
$$)
8181
);
82-
jsonb_pretty
83-
---------------------------------------------
84-
{ +
85-
"data": { +
86-
"__type": { +
87-
"kind": "OBJECT", +
88-
"fields": [ +
89-
{ +
90-
"name": "nodeId", +
91-
"type": { +
92-
"kind": "NON_NULL",+
93-
"name": null +
94-
} +
95-
}, +
96-
{ +
97-
"name": "workId", +
98-
"type": { +
99-
"kind": "NON_NULL",+
100-
"name": null +
101-
} +
102-
}, +
103-
{ +
104-
"name": "work", +
105-
"type": { +
106-
"kind": "NON_NULL",+
107-
"name": null +
108-
} +
109-
} +
110-
] +
111-
} +
112-
} +
82+
jsonb_pretty
83+
-------------------------------------------------------
84+
{ +
85+
"data": { +
86+
"__type": { +
87+
"kind": "OBJECT", +
88+
"fields": [ +
89+
{ +
90+
"name": "nodeId", +
91+
"type": { +
92+
"kind": "NON_NULL", +
93+
"name": null +
94+
} +
95+
}, +
96+
{ +
97+
"name": "workId", +
98+
"type": { +
99+
"kind": "NON_NULL", +
100+
"name": null +
101+
} +
102+
}, +
103+
{ +
104+
"name": "readthroughsCollection",+
105+
"type": { +
106+
"kind": "NON_NULL", +
107+
"name": null +
108+
} +
109+
} +
110+
] +
111+
} +
112+
} +
113113
}
114114
(1 row)
115115

0 commit comments

Comments
 (0)