From 125e0c6e012d0c2c6c22da522a97586365fd688b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20F=C3=B6rster?= Date: Wed, 22 Jan 2025 12:48:29 +0100 Subject: [PATCH] SQL: Fix subjects' unique check function --- .../migration/R__func_subjects_is_unique_type_identifier.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metasvc-server/backend-jdbi/src/main/resources/io/github/dbmdz/metadata/server/backend/impl/database/migration/R__func_subjects_is_unique_type_identifier.sql b/metasvc-server/backend-jdbi/src/main/resources/io/github/dbmdz/metadata/server/backend/impl/database/migration/R__func_subjects_is_unique_type_identifier.sql index 3e53240f8..c5781b941 100644 --- a/metasvc-server/backend-jdbi/src/main/resources/io/github/dbmdz/metadata/server/backend/impl/database/migration/R__func_subjects_is_unique_type_identifier.sql +++ b/metasvc-server/backend-jdbi/src/main/resources/io/github/dbmdz/metadata/server/backend/impl/database/migration/R__func_subjects_is_unique_type_identifier.sql @@ -14,7 +14,7 @@ declare tuple_exists boolean; begin if ids is null or cardinality(ids) = 0 then - execute 'select exists(select 1 from public.subjects where $1 = type and $2 = label and coalesce(identifiers, array[]::dbidentifier[]) = array[]::dbidentifier[] and $3 <> uuid)' + execute 'select exists(select 1 from public.subjects where $1 = type and $2 = label and coalesce(identifiers, array[]::public.dbidentifier[]) = array[]::public.dbidentifier[] and $3 <> uuid)' into tuple_exists using ptype, plabel, puuid; if tuple_exists then