-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into CIRCSTORE-540
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/main/resources/templates/db_scripts/createIsbnFunctions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
-- Usage: SELECT normalize_isbns(jsonb->'identifiers') FROM instance | ||
-- This takes each ISBN, normalizes it using RMB's normalize_digits(text), | ||
-- and concatenates the results using a space as separator. | ||
CREATE OR REPLACE FUNCTION normalize_isbns(jsonb_array jsonb) RETURNS text AS $$ | ||
SELECT string_agg(normalize_digits(identifiers->>'value'), ' ') | ||
CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.normalize_isbns(jsonb_array jsonb) RETURNS text AS $$ | ||
SELECT string_agg(${myuniversity}_${mymodule}.normalize_digits(identifiers->>'value'), ' ') | ||
FROM jsonb_array_elements($1) as identifiers | ||
WHERE identifiers->>'identifierTypeId' = '8261054f-be78-422d-bd51-4ed9f33c3422'; | ||
$$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; |