/Library/Java/JavaVirtualMachines/jdk-17.0.5.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -jar /Users/siarhei/Workspace/mod-data-export/target/mod-data-export-fat.jar db_connection=/tmp/postgres-conf.json WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance. starting rest verticle service.......... 13:23:01 [] [] [] [] WARN dressStreamProviders Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos' 13:23:01 [] [] [] [] INFO RestVerticle git: https://github.com/folio-org/raml-module-builder.git f04cbc672312039e3dc0d7ca27e9eebfba6c1713 13:23:01 [] [] [] [] INFO RestVerticle Setting path to db config file.... /tmp/postgres-conf.json 13:23:01 [] [] [] [] INFO RestVerticle metrics enabled: false 13:23:01 [] [] [] [] INFO Messages Loading messages from /infra-messages/APIMessages_en.properties ................................ 13:23:01 [] [] [] [] INFO Messages Loading messages from /infra-messages/APIMessages_de.properties ................................ 13:23:01 [] [] [] [] INFO Version HV000001: Hibernate Validator null 13:23:02 [] [] [] [] INFO RestRouting Adding route GET /_/jsonSchemas -> getJsonSchemas 13:23:03 [] [] [] [] INFO RestRouting Adding route DELETE /_/tenant/{operation_id} -> deleteTenantByOperationId 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /_/tenant/{operation_id} -> getTenantByOperationId 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /_/tenant -> postTenant 13:23:03 [] [] [] [] INFO RestRouting Adding route DELETE /data-export/job-executions/{id} -> deleteDataExportJobExecutionsById 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /data-export/job-executions -> getDataExportJobExecutions 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /data-export/job-executions/{jobExecutionId}/download/{exportFileId} -> getDataExportJobExecutionsDownloadByJobExecutionIdAndExportFileId 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /data-export/clean-up-files -> postDataExportCleanUpFiles 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /data-export/expire-jobs -> postDataExportExpireJobs 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /data-export/export -> postDataExportExport 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /data-export/quick-export -> postDataExportQuickExport 13:23:03 [] [] [] [] INFO RestRouting Adding route DELETE /admin/kill_query -> deleteAdminKillQuery 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/cache_hit_rates -> getAdminCacheHitRates 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/db_cache_summary -> getAdminDbCacheSummary 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/health -> getAdminHealth 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/jstack -> getAdminJstack 13:23:03 [] [] [] [] INFO RestRouting Adding route PUT /admin/jstack -> putAdminJstack 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/list_locking_queries -> getAdminListLockingQueries 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/loglevel -> getAdminLoglevel 13:23:03 [] [] [] [] INFO RestRouting Adding route PUT /admin/loglevel -> putAdminLoglevel 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/memory -> getAdminMemory 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_active_sessions -> getAdminPostgresActiveSessions 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_load -> getAdminPostgresLoad 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_table_access_stats -> getAdminPostgresTableAccessStats 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_table_size -> getAdminPostgresTableSize 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/slow_queries -> getAdminSlowQueries 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/table_index_usage -> getAdminTableIndexUsage 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /admin/total_db_size -> getAdminTotalDbSize 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /admin/get_password -> postAdminGetPassword 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /admin/importSQL -> postAdminImportSQL 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /admin/postgres_maintenance -> postAdminPostgresMaintenance 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /admin/set_AES_key -> postAdminSetAESKey 13:23:03 [] [] [] [] INFO RestRouting Adding route PUT /admin/postgres_create_indexes -> putAdminPostgresCreateIndexes 13:23:03 [] [] [] [] INFO RestRouting Adding route PUT /admin/postgres_drop_indexes -> putAdminPostgresDropIndexes 13:23:03 [] [] [] [] INFO RestRouting Adding route DELETE /data-export/job-profiles/{id} -> deleteDataExportJobProfilesById 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /data-export/job-profiles/{id} -> getDataExportJobProfilesById 13:23:03 [] [] [] [] INFO RestRouting Adding route PUT /data-export/job-profiles/{id} -> putDataExportJobProfilesById 13:23:03 [] [] [] [] INFO RestRouting Adding route GET /data-export/job-profiles -> getDataExportJobProfiles 13:23:03 [] [] [] [] INFO RestRouting Adding route POST /data-export/job-profiles -> postDataExportJobProfiles 13:23:04 [] [] [] [] INFO RestRouting Adding route GET /data-export/file-definitions/{fileDefinitionId} -> getDataExportFileDefinitionsByFileDefinitionId 13:23:04 [] [] [] [] INFO RestRouting Adding route POST /data-export/file-definitions -> postDataExportFileDefinitions 13:23:04 [] [] [] [] INFO RestRouting Adding route POST /data-export/file-definitions/{fileDefinitionId}/upload -> postDataExportFileDefinitionsUploadByFileDefinitionId 13:23:04 [] [] [] [] INFO RestRouting Adding route GET /data-export/transformation-fields -> getDataExportTransformationFields 13:23:04 [] [] [] [] INFO RestRouting Adding route GET /data-export/logs -> getDataExportLogs 13:23:04 [] [] [] [] INFO RestRouting Looks like org.folio.rest.jaxrs.resource.Rmbtests is not implemented 13:23:05 [] [] [] [] INFO RestRouting Adding route DELETE /data-export/mapping-profiles/{id} -> deleteDataExportMappingProfilesById 13:23:05 [] [] [] [] INFO RestRouting Adding route GET /data-export/mapping-profiles/{id} -> getDataExportMappingProfilesById 13:23:05 [] [] [] [] INFO RestRouting Adding route PUT /data-export/mapping-profiles/{id} -> putDataExportMappingProfilesById 13:23:05 [] [] [] [] INFO RestRouting Adding route GET /data-export/mapping-profiles -> getDataExportMappingProfiles 13:23:05 [] [] [] [] INFO RestRouting Adding route POST /data-export/mapping-profiles -> postDataExportMappingProfiles 13:23:05 [] [] [] [] INFO RestRouting Adding route GET /_/ramls -> getRamls 13:23:05 [] [] [] [] INFO RestVerticle Init hook called with implemented class named org.folio.rest.impl.InitAPIImpl 13:23:06 [] [] [] [] INFO RestVerticle Listening port 8081 13:23:06 [] [] [] [] INFO RestVerticle No periodic implementation found, continuing with deployment 13:23:06 [] [] [] [] INFO RestVerticle No Post Deploy Hook implementation found, continuing with deployment 13:23:06 [] [] [] [] INFO ? Succeeded in deploying verticle 13:23:10 [] [testtenant] [] [mod_data_export] INFO RestRouting invoking postTenant 13:23:10 [] [testtenant] [] [mod_data_export] INFO LoadConfs Loading File: /tmp/postgres-conf.json 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient postgreSQLClientConfig = {"host":"localhost","port":5432,"username":"folio","password":"...","database":"folio","postgres_tester":false} 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Executing multiple statements with id 824933532 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE ROLE testtenant_mod_data_export PASSWORD 'testtenant' NOSUPERUSER NOCREATEDB INHERIT LOGIN; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE ROLE testtenant_mod_data_export PASSWORD 'testtenant' NOSUPERUSER NOCREATEDB INHERIT LOGIN; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} GRANT testtenant_mod_data_export TO CURRENT_USER; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed GRANT testtenant_mod_data_export TO CURRENT_USER; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE SCHEMA testtenant_mod_data_export AUTHORIZATION testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE SCHEMA testtenant_mod_data_export AUTHORIZATION testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER ROLE testtenant_mod_data_export SET search_path = "$user"; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER ROLE testtenant_mod_data_export SET search_path = "$user"; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ BEGIN BEGIN -- This only succeeds if show_trgm, a pg_trgm function, -- has been loaded into public schema. PERFORM public.show_trgm('a'); EXCEPTION WHEN undefined_function THEN BEGIN ALTER EXTENSION pg_trgm SET SCHEMA public; EXCEPTION WHEN undefined_object THEN NULL; END; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ BEGIN BEGIN -- This only succeeds if show_trgm, a pg_trgm function, -- has been loaded into public schema. PERFORM public.show_trgm('a'); EXCEPTION WHEN undefined_function THEN BEGIN ALTER EXTENSION pg_trgm SET SCHEMA public; EXCEPTION WHEN undefined_object THEN NULL; END; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.rmb_internal ( id SERIAL PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.rmb_internal ( id SERIAL PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} insert into testtenant_mod_data_export.rmb_internal (jsonb) values ('{"rmbVersion": "35.0.1", "moduleVersion": "mod-data-export-4.7.1"}'::jsonb); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed insert into testtenant_mod_data_export.rmb_internal (jsonb) values ('{"rmbVersion": "35.0.1", "moduleVersion": "mod-data-export-4.7.1"}'::jsonb); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.rmb_job ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.rmb_job ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO LogUtil 127.0.0.1:52524 POST /_/tenant null HTTP_1_1 201 278 637 tid=testtenant Created 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Executing multiple statements with id -756909255 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} SET search_path TO testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed SET search_path TO testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.rmb_internal_index ( name text PRIMARY KEY, def text NOT NULL, remove boolean NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.rmb_internal_index ( name text PRIMARY KEY, def text NOT NULL, remove boolean NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.rmb_internal_index SET remove = TRUE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.rmb_internal_index SET remove = TRUE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS rmb_internal_analyze ( tablename text ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS rmb_internal_analyze ( tablename text ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.uuid_smaller(uuid, uuid) RETURNS uuid AS $$ BEGIN IF $1 IS NULL THEN RETURN $2; END IF; IF $2 IS NULL THEN RETURN $1; END IF; IF $1 < $2 THEN RETURN $1; ELSE RETURN $2; END IF; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.uuid_smaller(uuid, uuid) RETURNS uuid AS $$ BEGIN IF $1 IS NULL THEN RETURN $2; END IF; IF $2 IS NULL THEN RETURN $1; END IF; IF $1 < $2 THEN RETURN $1; ELSE RETURN $2; END IF; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.uuid_larger(uuid, uuid) RETURNS uuid AS $$ BEGIN IF $1 IS NULL THEN RETURN $2; END IF; IF $2 IS NULL THEN RETURN $1; END IF; IF $1 > $2 THEN RETURN $1; ELSE RETURN $2; END IF; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.uuid_larger(uuid, uuid) RETURNS uuid AS $$ BEGIN IF $1 IS NULL THEN RETURN $2; END IF; IF $2 IS NULL THEN RETURN $1; END IF; IF $1 > $2 THEN RETURN $1; ELSE RETURN $2; END IF; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.next_uuid(uuid) RETURNS uuid AS $$ DECLARE uuid text; digit text; BEGIN uuid = $1; FOR i IN REVERSE 36..1 LOOP digit := substring(uuid from i for 1); -- skip minus, version byte M and variant byte N CONTINUE WHEN digit = '-' OR i = 15 OR i = 20; CASE digit WHEN '0' THEN digit := '1'; WHEN '1' THEN digit := '2'; WHEN '2' THEN digit := '3'; WHEN '3' THEN digit := '4'; WHEN '4' THEN digit := '5'; WHEN '5' THEN digit := '6'; WHEN '6' THEN digit := '7'; WHEN '7' THEN digit := '8'; WHEN '8' THEN digit := '9'; WHEN '9' THEN digit := 'a'; WHEN 'a' THEN digit := 'b'; WHEN 'b' THEN digit := 'c'; WHEN 'c' THEN digit := 'd'; WHEN 'd' THEN digit := 'e'; WHEN 'e' THEN digit := 'f'; WHEN 'f' THEN digit := '0'; ELSE NULL; END CASE; uuid = overlay(uuid placing digit from i); EXIT WHEN digit <> '0'; END LOOP; RETURN uuid; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.next_uuid(uuid) RETURNS uuid AS $$ DECLARE uuid text; digit text; BEGIN uuid = $1; FOR i IN REVERSE 36..1 LOOP digit := substring(uuid from i for 1); -- skip minus, version byte M and variant byte N CONTINUE WHEN digit = '-' OR i = 15 OR i = 20; CASE digit WHEN '0' THEN digit := '1'; WHEN '1' THEN digit := '2'; WHEN '2' THEN digit := '3'; WHEN '3' THEN digit := '4'; WHEN '4' THEN digit := '5'; WHEN '5' THEN digit := '6'; WHEN '6' THEN digit := '7'; WHEN '7' THEN digit := '8'; WHEN '8' THEN digit := '9'; WHEN '9' THEN digit := 'a'; WHEN 'a' THEN digit := 'b'; WHEN 'b' THEN digit := 'c'; WHEN 'c' THEN digit := 'd'; WHEN 'd' THEN digit := 'e'; WHEN 'e' THEN digit := 'f'; WHEN 'f' THEN digit := '0'; ELSE NULL; END CASE; uuid = overlay(uuid placing digit from i); EXIT WHEN digit <> '0'; END LOOP; RETURN uuid; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE AGGREGATE testtenant_mod_data_export.max(uuid) ( stype = uuid, sfunc = testtenant_mod_data_export.uuid_larger, combinefunc = testtenant_mod_data_export.uuid_larger, parallel = safe, sortop = operator (>) ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE AGGREGATE testtenant_mod_data_export.max(uuid) ( stype = uuid, sfunc = testtenant_mod_data_export.uuid_larger, combinefunc = testtenant_mod_data_export.uuid_larger, parallel = safe, sortop = operator (>) ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE AGGREGATE testtenant_mod_data_export.min(uuid) ( stype = uuid, sfunc = testtenant_mod_data_export.uuid_smaller, combinefunc = testtenant_mod_data_export.uuid_smaller, parallel = safe, sortop = operator (<) ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE AGGREGATE testtenant_mod_data_export.min(uuid) ( stype = uuid, sfunc = testtenant_mod_data_export.uuid_smaller, combinefunc = testtenant_mod_data_export.uuid_smaller, parallel = safe, sortop = operator (<) ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.count_estimate_smart2(bigint,bigint,text); 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.count_estimate_smart2(pg_catalog.int8,pg_catalog.int8,text) does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.count_estimate_smart2(bigint,bigint,text); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE FUNCTION testtenant_mod_data_export.count_estimate_smart2(rows bigint, lim bigint, query text) RETURNS bigint AS $$ DECLARE rec record; cnt bigint; BEGIN IF rows = lim THEN FOR rec IN EXECUTE 'EXPLAIN ' || query LOOP cnt := substring(rec."QUERY PLAN" FROM ' rows=([[:digit:]]+)'); EXIT WHEN cnt IS NOT NULL; END LOOP; RETURN cnt; END IF; RETURN rows; END; $$ LANGUAGE plpgsql VOLATILE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE FUNCTION testtenant_mod_data_export.count_estimate_smart2(rows bigint, lim bigint, query text) RETURNS bigint AS $$ DECLARE rec record; cnt bigint; BEGIN IF rows = lim THEN FOR rec IN EXECUTE 'EXPLAIN ' || query LOOP cnt := substring(rec."QUERY PLAN" FROM ' rows=([[:digit:]]+)'); EXIT WHEN cnt IS NOT NULL; END LOOP; RETURN cnt; END IF; RETURN rows; END; $$ LANGUAGE plpgsql VOLATILE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.count_estimate_default(query text) RETURNS bigint AS $$ DECLARE rows bigint; q text; BEGIN q = 'SELECT COUNT(*) FROM (' || query || ' LIMIT 1000) x'; EXECUTE q INTO rows; IF rows < 1000 THEN return rows; END IF; rows = testtenant_mod_data_export.count_estimate_smart2(1000, 1000, query); IF rows < 1000 THEN return 1000; END IF; RETURN rows; END; $$ LANGUAGE plpgsql IMMUTABLE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.count_estimate_default(query text) RETURNS bigint AS $$ DECLARE rows bigint; q text; BEGIN q = 'SELECT COUNT(*) FROM (' || query || ' LIMIT 1000) x'; EXECUTE q INTO rows; IF rows < 1000 THEN return rows; END IF; rows = testtenant_mod_data_export.count_estimate_smart2(1000, 1000, query); IF rows < 1000 THEN return 1000; END IF; RETURN rows; END; $$ LANGUAGE plpgsql IMMUTABLE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.count_estimate(query text) RETURNS bigint AS $$ DECLARE count bigint; est_count bigint; q text; BEGIN est_count = testtenant_mod_data_export.count_estimate_smart2(1000, 1000, query); IF est_count > 4*1000 THEN RETURN est_count; END IF; q = 'SELECT COUNT(*) FROM (' || query || ' LIMIT 1000) x'; EXECUTE q INTO count; IF count < 1000 THEN RETURN count; END IF; IF est_count < 1000 THEN RETURN 1000; END IF; RETURN est_count; END; $$ LANGUAGE plpgsql STABLE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.count_estimate(query text) RETURNS bigint AS $$ DECLARE count bigint; est_count bigint; q text; BEGIN est_count = testtenant_mod_data_export.count_estimate_smart2(1000, 1000, query); IF est_count > 4*1000 THEN RETURN est_count; END IF; q = 'SELECT COUNT(*) FROM (' || query || ' LIMIT 1000) x'; EXECUTE q INTO count; IF count < 1000 THEN RETURN count; END IF; IF est_count < 1000 THEN RETURN 1000; END IF; RETURN est_count; END; $$ LANGUAGE plpgsql STABLE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.upsert(text, uuid, anyelement) RETURNS uuid AS $$ DECLARE ret uuid; BEGIN EXECUTE format('UPDATE testtenant_mod_data_export.%I SET jsonb=$3 WHERE id=$2 RETURNING id', $1) USING $1, $2, $3 INTO ret; IF ret IS NOT NULL THEN RETURN ret; END IF; EXECUTE format('INSERT INTO testtenant_mod_data_export.%I (id, jsonb) VALUES ($2, $3) RETURNING id', $1) USING $1, $2, $3 INTO STRICT ret; RETURN ret; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.upsert(text, uuid, anyelement) RETURNS uuid AS $$ DECLARE ret uuid; BEGIN EXECUTE format('UPDATE testtenant_mod_data_export.%I SET jsonb=$3 WHERE id=$2 RETURNING id', $1) USING $1, $2, $3 INTO ret; IF ret IS NOT NULL THEN RETURN ret; END IF; EXECUTE format('INSERT INTO testtenant_mod_data_export.%I (id, jsonb) VALUES ($2, $3) RETURNING id', $1) USING $1, $2, $3 INTO STRICT ret; RETURN ret; END; $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ DECLARE ver integer; BEGIN SELECT current_setting('server_version_num') INTO ver; IF (ver >= 120000) THEN CREATE OR REPLACE FUNCTION testtenant_mod_data_export.f_unaccent(text) RETURNS text AS $f_unaccent$ SELECT public.unaccent('public.unaccent', $1) -- schema-qualify function and dictionary $f_unaccent$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; ELSE CREATE OR REPLACE FUNCTION testtenant_mod_data_export.f_unaccent(text) RETURNS text AS $f_unaccent$ SELECT regexp_replace(public.unaccent('public.unaccent', $1), E'[\u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307\u0308\u0309\u030a\u030b\u030c\u030d\u030e\u030f' || E'\u0310\u0311\u0312\u0313\u0314\u0315\u0316\u0317\u0318\u0319\u031a\u031b\u031c\u031d\u031e\u031f' || E'\u0320\u0321\u0322\u0323\u0324\u0325\u0326\u0327\u0328\u0329\u032a\u032b\u032c\u032d\u032e\u032f' || E'\u0330\u0331\u0332\u0333\u0334\u0335\u0336\u0337\u0338\u0339\u033a\u033b\u033c\u033d\u033e\u033f' || E'\u0340\u0341\u0342\u0343\u0344\u0345\u0346\u0347\u0348\u0349\u034a\u034b\u034c\u034d\u034e\u034f' || E'\u0350\u0351\u0352\u0353\u0354\u0355\u0356\u0357\u0358\u0359\u035a\u035b\u035c\u035d\u035e\u035f' || E'\u0360\u0361\u0362' || E'\u20dd\u20de\u20df\u20e0' || E'\u20e2\u20e3\u20e4]', '', 'g') $f_unaccent$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; END IF; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ DECLARE ver integer; BEGIN SELECT current_setting('server_version_num') INTO ver; IF (ver >= 120000) THEN CREATE OR REPLACE FUNCTION testtenant_mod_data_export.f_unaccent(text) RETURNS text AS $f_unaccent$ SELECT public.unaccent('public.unaccent', $1) -- schema-qualify function and dictionary $f_unaccent$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; ELSE CREATE OR REPLACE FUNCTION testtenant_mod_data_export.f_unaccent(text) RETURNS text AS $f_unaccent$ SELECT regexp_replace(public.unaccent('public.unaccent', $1), E'[\u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307\u0308\u0309\u030a\u030b\u030c\u030d\u030e\u030f' || E'\u0310\u0311\u0312\u0313\u0314\u0315\u0316\u0317\u0318\u0319\u031a\u031b\u031c\u031d\u031e\u031f' || E'\u0320\u0321\u0322\u0323\u0324\u0325\u0326\u0327\u0328\u0329\u032a\u032b\u032c\u032d\u032e\u032f' || E'\u0330\u0331\u0332\u0333\u0334\u0335\u0336\u0337\u0338\u0339\u033a\u033b\u033c\u033d\u033e\u033f' || E'\u0340\u0341\u0342\u0343\u0344\u0345\u0346\u0347\u0348\u0349\u034a\u034b\u034c\u034d\u034e\u034f' || E'\u0350\u0351\u0352\u0353\u0354\u0355\u0356\u0357\u0358\u0359\u035a\u035b\u035c\u035d\u035e\u035f' || E'\u0360\u0361\u0362' || E'\u20dd\u20de\u20df\u20e0' || E'\u20e2\u20e3\u20e4]', '', 'g') $f_unaccent$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; END IF; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.get_tsvector(text) RETURNS tsvector AS $$ SELECT to_tsvector('simple', translate($1, '&', ',')); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.get_tsvector(text) RETURNS tsvector AS $$ SELECT to_tsvector('simple', translate($1, '&', ',')); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.tsquery_and(text) RETURNS tsquery AS $$ SELECT to_tsquery('simple', string_agg(CASE WHEN length(v) = 0 OR v = '*' THEN '' WHEN right(v, 1) = '*' THEN '''' || left(v, -1) || ''':*' ELSE '''' || v || '''' END, '&')) FROM (SELECT regexp_split_to_table(translate($1, '&''', ',,'), ' +')) AS x(v); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.tsquery_and(text) RETURNS tsquery AS $$ SELECT to_tsquery('simple', string_agg(CASE WHEN length(v) = 0 OR v = '*' THEN '' WHEN right(v, 1) = '*' THEN '''' || left(v, -1) || ''':*' ELSE '''' || v || '''' END, '&')) FROM (SELECT regexp_split_to_table(translate($1, '&''', ',,'), ' +')) AS x(v); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.tsquery_or(text) RETURNS tsquery AS $$ SELECT replace(testtenant_mod_data_export.tsquery_and($1)::text, '&', '|')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.tsquery_or(text) RETURNS tsquery AS $$ SELECT replace(testtenant_mod_data_export.tsquery_and($1)::text, '&', '|')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.tsquery_phrase(text) RETURNS tsquery AS $$ SELECT replace(testtenant_mod_data_export.tsquery_and($1)::text, '&', '<->')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.tsquery_phrase(text) RETURNS tsquery AS $$ SELECT replace(testtenant_mod_data_export.tsquery_and($1)::text, '&', '<->')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.normalize_digits(text) RETURNS text AS $$ SELECT translate((regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[1], E' \t-', '') || CASE WHEN (regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[1] = '' THEN '' WHEN (regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[2] = '' THEN '' ELSE ' ' END || (regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[2]; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.normalize_digits(text) RETURNS text AS $$ SELECT translate((regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[1], E' \t-', '') || CASE WHEN (regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[1] = '' THEN '' WHEN (regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[2] = '' THEN '' ELSE ' ' END || (regexp_match($1, '^([0-9 \t-]*(?:\*[ \t]*)?)(.*)'))[2]; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_id_in_jsonb() RETURNS TRIGGER AS $$ BEGIN NEW.jsonb = jsonb_set(NEW.jsonb, '{id}', to_jsonb(NEW.id)); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_id_in_jsonb() RETURNS TRIGGER AS $$ BEGIN NEW.jsonb = jsonb_set(NEW.jsonb, '{id}', to_jsonb(NEW.id)); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} create or replace function testtenant_mod_data_export.concat_space_sql(VARIADIC text[]) RETURNS text AS $$ select concat_ws(' ', VARIADIC $1); $$ LANGUAGE SQL IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed create or replace function testtenant_mod_data_export.concat_space_sql(VARIADIC text[]) RETURNS text AS $$ select concat_ws(' ', VARIADIC $1); $$ LANGUAGE SQL IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} create or replace function testtenant_mod_data_export.concat_array_object_values(jsonb_array jsonb, field text) RETURNS text AS $$ SELECT string_agg(value->>$2, ' ') FROM jsonb_array_elements($1); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed create or replace function testtenant_mod_data_export.concat_array_object_values(jsonb_array jsonb, field text) RETURNS text AS $$ SELECT string_agg(value->>$2, ' ') FROM jsonb_array_elements($1); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} create or replace function testtenant_mod_data_export.concat_array_object_values( jsonb_array jsonb, field text, filterkey text, filtervalue text) RETURNS text AS $$ SELECT string_agg(value->>$2, ' ') FROM jsonb_array_elements($1) WHERE value->>$3 = $4; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed create or replace function testtenant_mod_data_export.concat_array_object_values( jsonb_array jsonb, field text, filterkey text, filtervalue text) RETURNS text AS $$ SELECT string_agg(value->>$2, ' ') FROM jsonb_array_elements($1) WHERE value->>$3 = $4; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} create or replace function testtenant_mod_data_export.first_array_object_value( jsonb_array jsonb, field text, filterkey text, filtervalue text) RETURNS text AS $$ SELECT value->>$2 FROM jsonb_array_elements($1) WHERE value->>$3 = $4 LIMIT 1; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed create or replace function testtenant_mod_data_export.first_array_object_value( jsonb_array jsonb, field text, filterkey text, filtervalue text) RETURNS text AS $$ SELECT value->>$2 FROM jsonb_array_elements($1) WHERE value->>$3 = $4 LIMIT 1; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} create or replace function testtenant_mod_data_export.concat_array_object(jsonb_array jsonb) RETURNS text AS $$ SELECT string_agg(value::text, ' ') FROM jsonb_array_elements_text($1); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed create or replace function testtenant_mod_data_export.concat_array_object(jsonb_array jsonb) RETURNS text AS $$ SELECT string_agg(value::text, ' ') FROM jsonb_array_elements_text($1); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS rmb_internal_index(aname text, tops text, newdef text); 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function rmb_internal_index(text,text,text) does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS rmb_internal_index(aname text, tops text, newdef text); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION rmb_internal_index( atable text, aname text, tops text, newdef text) RETURNS void AS $$ DECLARE olddef text; namep CONSTANT text = concat(aname, '_p'); prepareddef text; BEGIN IF tops = 'DELETE' THEN -- use case insensitive %s, not case sensitive %I -- no SQL injection because the names are hard-coded in schema.json EXECUTE format('DROP INDEX IF EXISTS %s', aname); EXECUTE 'DELETE FROM testtenant_mod_data_export.rmb_internal_index WHERE name = $1' USING aname; RETURN; END IF; SELECT def INTO olddef FROM testtenant_mod_data_export.rmb_internal_index WHERE name = aname; SELECT def INTO prepareddef FROM testtenant_mod_data_export.rmb_internal_index WHERE name = namep; prepareddef = replace(prepareddef, concat(' ', namep, ' ON '), concat(' ', aname, ' ON ')); IF prepareddef = newdef THEN EXECUTE format('DROP INDEX IF EXISTS %s', aname); EXECUTE format('ALTER INDEX IF EXISTS %s RENAME TO %s', namep, aname); EXECUTE 'DELETE FROM rmb_internal_index WHERE name = $1' USING namep; EXECUTE 'INSERT INTO rmb_internal_analyze VALUES ($1)' USING atable; ELSIF olddef IS DISTINCT FROM newdef THEN EXECUTE format('DROP INDEX IF EXISTS %s', aname); EXECUTE newdef; EXECUTE 'INSERT INTO rmb_internal_analyze VALUES ($1)' USING atable; END IF; EXECUTE 'INSERT INTO testtenant_mod_data_export.rmb_internal_index VALUES ($1, $2, FALSE) ' 'ON CONFLICT (name) DO UPDATE SET def = EXCLUDED.def, remove = EXCLUDED.remove' USING aname, newdef; END $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION rmb_internal_index( atable text, aname text, tops text, newdef text) RETURNS void AS $$ DECLARE olddef text; namep CONSTANT text = concat(aname, '_p'); prepareddef text; BEGIN IF tops = 'DELETE' THEN -- use case insensitive %s, not case sensitive %I -- no SQL injection because the names are hard-coded in schema.json EXECUTE format('DROP INDEX IF EXISTS %s', aname); EXECUTE 'DELETE FROM testtenant_mod_data_export.rmb_internal_index WHERE name = $1' USING aname; RETURN; END IF; SELECT def INTO olddef FROM testtenant_mod_data_export.rmb_internal_index WHERE name = aname; SELECT def INTO prepareddef FROM testtenant_mod_data_export.rmb_internal_index WHERE name = namep; prepareddef = replace(prepareddef, concat(' ', namep, ' ON '), concat(' ', aname, ' ON ')); IF prepareddef = newdef THEN EXECUTE format('DROP INDEX IF EXISTS %s', aname); EXECUTE format('ALTER INDEX IF EXISTS %s RENAME TO %s', namep, aname); EXECUTE 'DELETE FROM rmb_internal_index WHERE name = $1' USING namep; EXECUTE 'INSERT INTO rmb_internal_analyze VALUES ($1)' USING atable; ELSIF olddef IS DISTINCT FROM newdef THEN EXECUTE format('DROP INDEX IF EXISTS %s', aname); EXECUTE newdef; EXECUTE 'INSERT INTO rmb_internal_analyze VALUES ($1)' USING atable; END IF; EXECUTE 'INSERT INTO testtenant_mod_data_export.rmb_internal_index VALUES ($1, $2, FALSE) ' 'ON CONFLICT (name) DO UPDATE SET def = EXCLUDED.def, remove = EXCLUDED.remove' USING aname, newdef; END $$ LANGUAGE plpgsql; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ BEGIN -- use advisory lock to prevent "tuple concurrently updated" -- https://issues.folio.org/browse/RMB-744 PERFORM pg_advisory_xact_lock(20201101, 1234567890); REVOKE ALL PRIVILEGES ON SCHEMA public FROM testtenant_mod_data_export; REVOKE CREATE ON SCHEMA public FROM PUBLIC; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ BEGIN -- use advisory lock to prevent "tuple concurrently updated" -- https://issues.folio.org/browse/RMB-744 PERFORM pg_advisory_xact_lock(20201101, 1234567890); REVOKE ALL PRIVILEGES ON SCHEMA public FROM testtenant_mod_data_export; REVOKE CREATE ON SCHEMA public FROM PUBLIC; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.file_definitions ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.file_definitions ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_injson_file_definitions ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_injson_file_definitions" for relation "testtenant_mod_data_export.file_definitions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_injson_file_definitions ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_in_jsonb" for relation "testtenant_mod_data_export.file_definitions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.file_definitions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.file_definitions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.file_definitions ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.file_definitions ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS update_file_definitions_references ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "update_file_definitions_references" for relation "testtenant_mod_data_export.file_definitions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS update_file_definitions_references ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.update_file_definitions_references(); 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.update_file_definitions_references() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.update_file_definitions_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.file_definitions_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.file_definitions_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_file_definitions_md_trigger ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_file_definitions_md_trigger" for relation "testtenant_mod_data_export.file_definitions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_file_definitions_md_trigger ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_file_definitions_md_trigger BEFORE INSERT ON testtenant_mod_data_export.file_definitions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.file_definitions_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_file_definitions_md_trigger BEFORE INSERT ON testtenant_mod_data_export.file_definitions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.file_definitions_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_file_definitions_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_file_definitions_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_file_definitions_md_json_trigger ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_file_definitions_md_json_trigger" for relation "testtenant_mod_data_export.file_definitions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_file_definitions_md_json_trigger ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_file_definitions_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.file_definitions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_file_definitions_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_file_definitions_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.file_definitions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_file_definitions_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_file_definitions_ol_version_trigger ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_file_definitions_ol_version_trigger" for relation "testtenant_mod_data_export.file_definitions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_file_definitions_ol_version_trigger ON testtenant_mod_data_export.file_definitions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.file_definitions_set_ol_version() CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.file_definitions_set_ol_version() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.file_definitions_set_ol_version() CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE SEQUENCE IF NOT EXISTS testtenant_mod_data_export.job_execution_hrId MINVALUE 1 NO MAXVALUE CACHE 1 NO CYCLE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE SEQUENCE IF NOT EXISTS testtenant_mod_data_export.job_execution_hrId MINVALUE 1 NO MAXVALUE CACHE 1 NO CYCLE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER SEQUENCE testtenant_mod_data_export.job_execution_hrId OWNER TO testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER SEQUENCE testtenant_mod_data_export.job_execution_hrId OWNER TO testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.mapping_profiles ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.mapping_profiles ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_injson_mapping_profiles ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_injson_mapping_profiles" for relation "testtenant_mod_data_export.mapping_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_injson_mapping_profiles ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_in_jsonb" for relation "testtenant_mod_data_export.mapping_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.mapping_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.mapping_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.mapping_profiles ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.mapping_profiles ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $do$ BEGIN PERFORM rmb_internal_index( 'mapping_profiles', 'mapping_profiles_name_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS mapping_profiles_name_idx_unique ON testtenant_mod_data_export.mapping_profiles ' || $rmb$(lower(f_unaccent(jsonb->>'name')))$rmb$ ); END $do$; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='index "mapping_profiles_name_idx_unique" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='SQL statement "DROP INDEX IF EXISTS mapping_profiles_name_idx_unique" PL/pgSQL function rmb_internal_index(text,text,text,text) line 23 at EXECUTE SQL statement "SELECT rmb_internal_index( 'mapping_profiles', 'mapping_profiles_name_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS mapping_profiles_name_idx_unique ON testtenant_mod_data_export.mapping_profiles ' || $rmb$(lower(f_unaccent(jsonb->>'name')))$rmb$ )" PL/pgSQL function inline_code_block line 3 at PERFORM', file='tablecmds.c', line='1201', routine='DropErrorMsgNonExistent', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $do$ BEGIN PERFORM rmb_internal_index( 'mapping_profiles', 'mapping_profiles_name_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS mapping_profiles_name_idx_unique ON testtenant_mod_data_export.mapping_profiles ' || $rmb$(lower(f_unaccent(jsonb->>'name')))$rmb$ ); END $do$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS update_mapping_profiles_references ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "update_mapping_profiles_references" for relation "testtenant_mod_data_export.mapping_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS update_mapping_profiles_references ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.update_mapping_profiles_references(); 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.update_mapping_profiles_references() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.update_mapping_profiles_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.mapping_profiles_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.mapping_profiles_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_mapping_profiles_md_trigger ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_mapping_profiles_md_trigger" for relation "testtenant_mod_data_export.mapping_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_mapping_profiles_md_trigger ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_mapping_profiles_md_trigger BEFORE INSERT ON testtenant_mod_data_export.mapping_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.mapping_profiles_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_mapping_profiles_md_trigger BEFORE INSERT ON testtenant_mod_data_export.mapping_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.mapping_profiles_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_mapping_profiles_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_mapping_profiles_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_mapping_profiles_md_json_trigger ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_mapping_profiles_md_json_trigger" for relation "testtenant_mod_data_export.mapping_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_mapping_profiles_md_json_trigger ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_mapping_profiles_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.mapping_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_mapping_profiles_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_mapping_profiles_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.mapping_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_mapping_profiles_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_mapping_profiles_ol_version_trigger ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_mapping_profiles_ol_version_trigger" for relation "testtenant_mod_data_export.mapping_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_mapping_profiles_ol_version_trigger ON testtenant_mod_data_export.mapping_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.mapping_profiles_set_ol_version() CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.mapping_profiles_set_ol_version() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.mapping_profiles_set_ol_version() CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.job_profiles ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.job_profiles ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_injson_job_profiles ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_injson_job_profiles" for relation "testtenant_mod_data_export.job_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_injson_job_profiles ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_in_jsonb" for relation "testtenant_mod_data_export.job_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.job_profiles ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.job_profiles ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $do$ BEGIN PERFORM rmb_internal_index( 'job_profiles', 'job_profiles_name_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS job_profiles_name_idx_unique ON testtenant_mod_data_export.job_profiles ' || $rmb$(lower(f_unaccent(jsonb->>'name')))$rmb$ ); END $do$; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='index "job_profiles_name_idx_unique" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='SQL statement "DROP INDEX IF EXISTS job_profiles_name_idx_unique" PL/pgSQL function rmb_internal_index(text,text,text,text) line 23 at EXECUTE SQL statement "SELECT rmb_internal_index( 'job_profiles', 'job_profiles_name_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS job_profiles_name_idx_unique ON testtenant_mod_data_export.job_profiles ' || $rmb$(lower(f_unaccent(jsonb->>'name')))$rmb$ )" PL/pgSQL function inline_code_block line 3 at PERFORM', file='tablecmds.c', line='1201', routine='DropErrorMsgNonExistent', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $do$ BEGIN PERFORM rmb_internal_index( 'job_profiles', 'job_profiles_name_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS job_profiles_name_idx_unique ON testtenant_mod_data_export.job_profiles ' || $rmb$(lower(f_unaccent(jsonb->>'name')))$rmb$ ); END $do$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.job_profiles ADD COLUMN IF NOT EXISTS mappingProfileId UUID; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.job_profiles ADD COLUMN IF NOT EXISTS mappingProfileId UUID; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ BEGIN BEGIN ALTER TABLE job_profiles ADD CONSTRAINT mappingProfileId_mapping_profiles_fkey FOREIGN KEY (mappingProfileId) REFERENCES mapping_profiles; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ BEGIN BEGIN ALTER TABLE job_profiles ADD CONSTRAINT mappingProfileId_mapping_profiles_fkey FOREIGN KEY (mappingProfileId) REFERENCES mapping_profiles; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE INDEX IF NOT EXISTS job_profiles_mappingProfileId_idx ON testtenant_mod_data_export.job_profiles (mappingProfileId); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE INDEX IF NOT EXISTS job_profiles_mappingProfileId_idx ON testtenant_mod_data_export.job_profiles (mappingProfileId); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} INSERT INTO rmb_internal_analyze VALUES ('job_profiles'); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed INSERT INTO rmb_internal_analyze VALUES ('job_profiles'); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.update_job_profiles_references() RETURNS TRIGGER AS $$ BEGIN NEW.mappingProfileId = (NEW.jsonb->>'mappingProfileId'); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.update_job_profiles_references() RETURNS TRIGGER AS $$ BEGIN NEW.mappingProfileId = (NEW.jsonb->>'mappingProfileId'); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS update_job_profiles_references ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "update_job_profiles_references" for relation "testtenant_mod_data_export.job_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS update_job_profiles_references ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER update_job_profiles_references BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.update_job_profiles_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER update_job_profiles_references BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.update_job_profiles_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE job_profiles DROP CONSTRAINT IF EXISTS ' || 'mappingProfileId_mapping_profiles_fkey' || i; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE job_profiles DROP CONSTRAINT IF EXISTS ' || 'mappingProfileId_mapping_profiles_fkey' || i; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.job_profiles_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.job_profiles_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_job_profiles_md_trigger ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_job_profiles_md_trigger" for relation "testtenant_mod_data_export.job_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_job_profiles_md_trigger ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_job_profiles_md_trigger BEFORE INSERT ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.job_profiles_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_job_profiles_md_trigger BEFORE INSERT ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.job_profiles_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_job_profiles_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_job_profiles_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_job_profiles_md_json_trigger ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_job_profiles_md_json_trigger" for relation "testtenant_mod_data_export.job_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_job_profiles_md_json_trigger ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_job_profiles_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_job_profiles_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_job_profiles_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.job_profiles FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_job_profiles_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_job_profiles_ol_version_trigger ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_job_profiles_ol_version_trigger" for relation "testtenant_mod_data_export.job_profiles" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_job_profiles_ol_version_trigger ON testtenant_mod_data_export.job_profiles CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.job_profiles_set_ol_version() CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.job_profiles_set_ol_version() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.job_profiles_set_ol_version() CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.job_executions ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.job_executions ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_injson_job_executions ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_injson_job_executions" for relation "testtenant_mod_data_export.job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_injson_job_executions ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_in_jsonb" for relation "testtenant_mod_data_export.job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_executions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_executions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.job_executions DROP COLUMN IF EXISTS creation_date CASCADE, DROP COLUMN IF EXISTS created_by CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='column "creation_date" of relation "job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='tablecmds.c', line='7522', routine='ATExecDropColumn', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='column "created_by" of relation "job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='tablecmds.c', line='7522', routine='ATExecDropColumn', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.job_executions DROP COLUMN IF EXISTS creation_date CASCADE, DROP COLUMN IF EXISTS created_by CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $do$ BEGIN PERFORM rmb_internal_index( 'job_executions', 'job_executions_status_idx', 'DELETE', 'CREATE INDEX IF NOT EXISTS job_executions_status_idx ON testtenant_mod_data_export.job_executions ' || $rmb$(left(lower(f_unaccent(jsonb->>'status')),600))$rmb$ ); END $do$; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='index "job_executions_status_idx" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='SQL statement "DROP INDEX IF EXISTS job_executions_status_idx" PL/pgSQL function rmb_internal_index(text,text,text,text) line 10 at EXECUTE SQL statement "SELECT rmb_internal_index( 'job_executions', 'job_executions_status_idx', 'DELETE', 'CREATE INDEX IF NOT EXISTS job_executions_status_idx ON testtenant_mod_data_export.job_executions ' || $rmb$(left(lower(f_unaccent(jsonb->>'status')),600))$rmb$ )" PL/pgSQL function inline_code_block line 3 at PERFORM', file='tablecmds.c', line='1201', routine='DropErrorMsgNonExistent', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $do$ BEGIN PERFORM rmb_internal_index( 'job_executions', 'job_executions_status_idx', 'DELETE', 'CREATE INDEX IF NOT EXISTS job_executions_status_idx ON testtenant_mod_data_export.job_executions ' || $rmb$(left(lower(f_unaccent(jsonb->>'status')),600))$rmb$ ); END $do$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $do$ BEGIN PERFORM rmb_internal_index( 'job_executions', 'job_executions_hrId_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS job_executions_hrId_idx_unique ON testtenant_mod_data_export.job_executions ' || $rmb$(lower(f_unaccent(jsonb->>'hrId')))$rmb$ ); END $do$; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='index "job_executions_hrid_idx_unique" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='SQL statement "DROP INDEX IF EXISTS job_executions_hrId_idx_unique" PL/pgSQL function rmb_internal_index(text,text,text,text) line 23 at EXECUTE SQL statement "SELECT rmb_internal_index( 'job_executions', 'job_executions_hrId_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS job_executions_hrId_idx_unique ON testtenant_mod_data_export.job_executions ' || $rmb$(lower(f_unaccent(jsonb->>'hrId')))$rmb$ )" PL/pgSQL function inline_code_block line 3 at PERFORM', file='tablecmds.c', line='1201', routine='DropErrorMsgNonExistent', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $do$ BEGIN PERFORM rmb_internal_index( 'job_executions', 'job_executions_hrId_idx_unique', 'ADD', 'CREATE UNIQUE INDEX IF NOT EXISTS job_executions_hrId_idx_unique ON testtenant_mod_data_export.job_executions ' || $rmb$(lower(f_unaccent(jsonb->>'hrId')))$rmb$ ); END $do$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $do$ BEGIN PERFORM rmb_internal_index( 'job_executions', 'job_executions_status_idx_ft', 'ADD', 'CREATE INDEX IF NOT EXISTS job_executions_status_idx_ft ON testtenant_mod_data_export.job_executions USING GIN ' || $rmb$( get_tsvector(f_unaccent(jsonb->>'status')) )$rmb$); END $do$; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='index "job_executions_status_idx_ft" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='SQL statement "DROP INDEX IF EXISTS job_executions_status_idx_ft" PL/pgSQL function rmb_internal_index(text,text,text,text) line 23 at EXECUTE SQL statement "SELECT rmb_internal_index( 'job_executions', 'job_executions_status_idx_ft', 'ADD', 'CREATE INDEX IF NOT EXISTS job_executions_status_idx_ft ON testtenant_mod_data_export.job_executions USING GIN ' || $rmb$( get_tsvector(f_unaccent(jsonb->>'status')) )$rmb$)" PL/pgSQL function inline_code_block line 3 at PERFORM', file='tablecmds.c', line='1201', routine='DropErrorMsgNonExistent', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $do$ BEGIN PERFORM rmb_internal_index( 'job_executions', 'job_executions_status_idx_ft', 'ADD', 'CREATE INDEX IF NOT EXISTS job_executions_status_idx_ft ON testtenant_mod_data_export.job_executions USING GIN ' || $rmb$( get_tsvector(f_unaccent(jsonb->>'status')) )$rmb$); END $do$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.job_executions ADD COLUMN IF NOT EXISTS jobProfileId UUID; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.job_executions ADD COLUMN IF NOT EXISTS jobProfileId UUID; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ BEGIN BEGIN ALTER TABLE job_executions ADD CONSTRAINT jobProfileId_job_profiles_fkey FOREIGN KEY (jobProfileId) REFERENCES job_profiles; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ BEGIN BEGIN ALTER TABLE job_executions ADD CONSTRAINT jobProfileId_job_profiles_fkey FOREIGN KEY (jobProfileId) REFERENCES job_profiles; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE INDEX IF NOT EXISTS job_executions_jobProfileId_idx ON testtenant_mod_data_export.job_executions (jobProfileId); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE INDEX IF NOT EXISTS job_executions_jobProfileId_idx ON testtenant_mod_data_export.job_executions (jobProfileId); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} INSERT INTO rmb_internal_analyze VALUES ('job_executions'); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed INSERT INTO rmb_internal_analyze VALUES ('job_executions'); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.update_job_executions_references() RETURNS TRIGGER AS $$ BEGIN NEW.jobProfileId = (NEW.jsonb->>'jobProfileId'); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.update_job_executions_references() RETURNS TRIGGER AS $$ BEGIN NEW.jobProfileId = (NEW.jsonb->>'jobProfileId'); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS update_job_executions_references ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "update_job_executions_references" for relation "testtenant_mod_data_export.job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS update_job_executions_references ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER update_job_executions_references BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_executions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.update_job_executions_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER update_job_executions_references BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.job_executions FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.update_job_executions_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE job_executions DROP CONSTRAINT IF EXISTS ' || 'jobProfileId_job_profiles_fkey' || i; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE job_executions DROP CONSTRAINT IF EXISTS ' || 'jobProfileId_job_profiles_fkey' || i; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.job_executions_set_md() CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.job_executions_set_md() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.job_executions_set_md() CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_job_executions_md_trigger ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_job_executions_md_trigger" for relation "testtenant_mod_data_export.job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_job_executions_md_trigger ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.set_job_executions_md_json() CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.set_job_executions_md_json() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.set_job_executions_md_json() CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_job_executions_md_json_trigger ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_job_executions_md_json_trigger" for relation "testtenant_mod_data_export.job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_job_executions_md_json_trigger ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_job_executions_ol_version_trigger ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_job_executions_ol_version_trigger" for relation "testtenant_mod_data_export.job_executions" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_job_executions_ol_version_trigger ON testtenant_mod_data_export.job_executions CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.job_executions_set_ol_version() CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.job_executions_set_ol_version() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.job_executions_set_ol_version() CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.error_logs ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TABLE IF NOT EXISTS testtenant_mod_data_export.error_logs ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_injson_error_logs ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_injson_error_logs" for relation "testtenant_mod_data_export.error_logs" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_injson_error_logs ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_id_in_jsonb" for relation "testtenant_mod_data_export.error_logs" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_id_in_jsonb ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_id_in_jsonb BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_id_in_jsonb(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.error_logs ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.error_logs ADD COLUMN IF NOT EXISTS creation_date timestamp, ADD COLUMN IF NOT EXISTS created_by text; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} ALTER TABLE testtenant_mod_data_export.error_logs ADD COLUMN IF NOT EXISTS jobProfileId UUID; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed ALTER TABLE testtenant_mod_data_export.error_logs ADD COLUMN IF NOT EXISTS jobProfileId UUID; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ BEGIN BEGIN ALTER TABLE error_logs ADD CONSTRAINT jobProfileId_job_profiles_fkey FOREIGN KEY (jobProfileId) REFERENCES job_profiles; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ BEGIN BEGIN ALTER TABLE error_logs ADD CONSTRAINT jobProfileId_job_profiles_fkey FOREIGN KEY (jobProfileId) REFERENCES job_profiles; EXCEPTION WHEN duplicate_object OR duplicate_table THEN NULL; END; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE INDEX IF NOT EXISTS error_logs_jobProfileId_idx ON testtenant_mod_data_export.error_logs (jobProfileId); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE INDEX IF NOT EXISTS error_logs_jobProfileId_idx ON testtenant_mod_data_export.error_logs (jobProfileId); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} INSERT INTO rmb_internal_analyze VALUES ('error_logs'); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed INSERT INTO rmb_internal_analyze VALUES ('error_logs'); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.update_error_logs_references() RETURNS TRIGGER AS $$ BEGIN NEW.jobProfileId = (NEW.jsonb->>'jobProfileId'); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.update_error_logs_references() RETURNS TRIGGER AS $$ BEGIN NEW.jobProfileId = (NEW.jsonb->>'jobProfileId'); RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS update_error_logs_references ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "update_error_logs_references" for relation "testtenant_mod_data_export.error_logs" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS update_error_logs_references ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER update_error_logs_references BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.update_error_logs_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER update_error_logs_references BEFORE INSERT OR UPDATE ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.update_error_logs_references(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE error_logs DROP CONSTRAINT IF EXISTS ' || 'jobProfileId_job_profiles_fkey' || i; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ DECLARE version TEXT; i INT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM rmb_internal; IF version !~ '^(\d\.|1\d\.|2\d\.|30\.0\.)' THEN RETURN; END IF; FOR i IN 1..50 LOOP EXECUTE 'ALTER TABLE error_logs DROP CONSTRAINT IF EXISTS ' || 'jobProfileId_job_profiles_fkey' || i; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.error_logs_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.error_logs_set_md() RETURNS TRIGGER AS $$ DECLARE input text; createdDate timestamp; BEGIN input = NEW.jsonb->'metadata'->>'createdDate'; IF input IS NULL THEN RETURN NEW; END IF; -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- createdDate already has no time zone, normalize using ::timestamp createdDate = input::timestamp; ELSE -- createdDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string createdDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(createdDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); NEW.creation_date = createdDate; NEW.created_by = NEW.jsonb->'metadata'->>'createdByUserId'; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_error_logs_md_trigger ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_error_logs_md_trigger" for relation "testtenant_mod_data_export.error_logs" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_error_logs_md_trigger ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_error_logs_md_trigger BEFORE INSERT ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.error_logs_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_error_logs_md_trigger BEFORE INSERT ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.error_logs_set_md(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_error_logs_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE OR REPLACE FUNCTION testtenant_mod_data_export.set_error_logs_md_json() RETURNS TRIGGER AS $$ DECLARE input text; updatedDate timestamp; BEGIN if NEW.creation_date IS NULL then RETURN NEW; end if; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdDate}', to_jsonb(to_char(NEW.creation_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); if NEW.created_by IS NULL then NEW.jsonb = NEW.jsonb #- '{metadata,createdByUserId}'; else NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,createdByUserId}', to_jsonb(NEW.created_by)); end if; input = NEW.jsonb->'metadata'->>'updatedDate'; if input IS NOT NULL then -- time stamp without time zone? IF (input::timestamp::timestamptz = input::timestamptz) THEN -- updatedDate already has no time zone, normalize using ::timestamp updatedDate = input::timestamp; ELSE -- updatedDate has a time zone string -- normalize using ::timestamptz, convert to '+00' time zone and remove time zone string updatedDate = input::timestamptz AT TIME ZONE '+00'; END IF; NEW.jsonb = jsonb_set(NEW.jsonb, '{metadata,updatedDate}', to_jsonb(to_char(updatedDate, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'))); end if; RETURN NEW; END; $$ language 'plpgsql'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_error_logs_md_json_trigger ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_error_logs_md_json_trigger" for relation "testtenant_mod_data_export.error_logs" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_error_logs_md_json_trigger ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} CREATE TRIGGER set_error_logs_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_error_logs_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed CREATE TRIGGER set_error_logs_md_json_trigger BEFORE UPDATE ON testtenant_mod_data_export.error_logs FOR EACH ROW EXECUTE PROCEDURE testtenant_mod_data_export.set_error_logs_md_json(); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP TRIGGER IF EXISTS set_error_logs_ol_version_trigger ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='trigger "set_error_logs_ol_version_trigger" for relation "testtenant_mod_data_export.error_logs" does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP TRIGGER IF EXISTS set_error_logs_ol_version_trigger ON testtenant_mod_data_export.error_logs CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DROP FUNCTION IF EXISTS testtenant_mod_data_export.error_logs_set_ol_version() CASCADE; 13:23:11 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function testtenant_mod_data_export.error_logs_set_ol_version() does not exist, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='null', file='dropcmds.c', line='491', routine='does_not_exist_skipping', schema='null', table='null', column='null', dataType='null', constraint='null' 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DROP FUNCTION IF EXISTS testtenant_mod_data_export.error_logs_set_ol_version() CASCADE; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb #- '{progress, current}', '{progress, exported}', jsonb -> 'progress' -> 'current') WHERE jsonb -> 'progress' -> 'current' IS NOT NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb #- '{progress, current}', '{progress, exported}', jsonb -> 'progress' -> 'current') WHERE jsonb -> 'progress' -> 'current' IS NOT NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb , '{jobProfileId}', '"6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a"') WHERE jsonb -> 'jobProfileId' IS NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb , '{jobProfileId}', '"6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a"') WHERE jsonb -> 'jobProfileId' IS NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{status}', '"FAIL"') WHERE jsonb -> 'progress' ->> 'exported' = '0' OR jsonb ->> 'status' = 'FAIL'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{status}', '"FAIL"') WHERE jsonb -> 'progress' ->> 'exported' = '0' OR jsonb ->> 'status' = 'FAIL'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{status}', '"COMPLETED"') WHERE jsonb -> 'progress' ->> 'failed' = '0' and jsonb -> 'progress' ->> 'exported' > '0' and jsonb ->> 'status' = 'SUCCESS'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{status}', '"COMPLETED"') WHERE jsonb -> 'progress' ->> 'failed' = '0' and jsonb -> 'progress' ->> 'exported' > '0' and jsonb ->> 'status' = 'SUCCESS'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{status}', '"COMPLETED_WITH_ERRORS"') WHERE jsonb -> 'progress' ->> 'failed' > '0' and jsonb -> 'progress' ->> 'exported' > '0'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{status}', '"COMPLETED_WITH_ERRORS"') WHERE jsonb -> 'progress' ->> 'failed' > '0' and jsonb -> 'progress' ->> 'exported' > '0'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{lastUpdatedDate}', to_jsonb(now()), true) WHERE jsonb -> 'lastUpdatedDate' IS NULL and jsonb -> 'completedDate' IS NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{lastUpdatedDate}', to_jsonb(now()), true) WHERE jsonb -> 'lastUpdatedDate' IS NULL and jsonb -> 'completedDate' IS NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{lastUpdatedDate}', jsonb->'completedDate', true) WHERE jsonb -> 'lastUpdatedDate' IS NULL and jsonb -> 'completedDate' IS NOT NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{lastUpdatedDate}', jsonb->'completedDate', true) WHERE jsonb -> 'lastUpdatedDate' IS NULL and jsonb -> 'completedDate' IS NOT NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb #- '{progress, total}', '{progress, total}', to_jsonb((jsonb -> 'progress' ->> 'total')::int)) WHERE jsonb -> 'progress' -> 'total' IS NOT NULL;; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb #- '{progress, total}', '{progress, total}', to_jsonb((jsonb -> 'progress' ->> 'total')::int)) WHERE jsonb -> 'progress' -> 'total' IS NOT NULL;; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{progress}', '{"total": 0, "failed": 0, "exported": 0}'::jsonb) WHERE jsonb -> 'progress' IS NULL OR jsonb -> 'progress' = '{}'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{progress}', '{"total": 0, "failed": 0, "exported": 0}'::jsonb) WHERE jsonb -> 'progress' IS NULL OR jsonb -> 'progress' = '{}'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{progress}', jsonb_build_object('total', jsonb -> 'progress' -> 'exported', 'failed', 0, 'exported', jsonb -> 'progress' -> 'exported')) WHERE jsonb -> 'progress' IS NOT NULL AND jsonb -> 'progress' <> '{}' AND jsonb -> 'progress' -> 'exported' IS NOT NULL AND jsonb -> 'progress' -> 'total' IS NULL AND jsonb -> 'progress' -> 'failed' IS NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_executions SET jsonb = jsonb_set(jsonb, '{progress}', jsonb_build_object('total', jsonb -> 'progress' -> 'exported', 'failed', 0, 'exported', jsonb -> 'progress' -> 'exported')) WHERE jsonb -> 'progress' IS NOT NULL AND jsonb -> 'progress' <> '{}' AND jsonb -> 'progress' -> 'exported' IS NOT NULL AND jsonb -> 'progress' -> 'total' IS NULL AND jsonb -> 'progress' -> 'failed' IS NULL; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles AS profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(transformations.value - 'hasSameTagInHoldings') FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY jsonb )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles AS profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(transformations.value - 'hasSameTagInHoldings') FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY jsonb )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'recordType' = 'HOLDINGS' AND transformations.value ->> 'fieldId' NOT LIKE '%holdings.%' THEN concat('holdings.', transformations.value ->> 'fieldId') WHEN transformations.value ->> 'recordType' = 'ITEM' AND transformations.value ->> 'fieldId' NOT LIKE '%item.%' THEN concat('item.', transformations.value ->> 'fieldId') WHEN transformations.value ->> 'recordType' = 'INSTANCE' AND transformations.value ->> 'fieldId' NOT LIKE '%instance.%' THEN concat('instance.', transformations.value ->> 'fieldId') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'recordType' = 'HOLDINGS' AND transformations.value ->> 'fieldId' NOT LIKE '%holdings.%' THEN concat('holdings.', transformations.value ->> 'fieldId') WHEN transformations.value ->> 'recordType' = 'ITEM' AND transformations.value ->> 'fieldId' NOT LIKE '%item.%' THEN concat('item.', transformations.value ->> 'fieldId') WHEN transformations.value ->> 'recordType' = 'INSTANCE' AND transformations.value ->> 'fieldId' NOT LIKE '%instance.%' THEN concat('instance.', transformations.value ->> 'fieldId') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%electronicAccess%' THEN regexp_replace(transformations.value ->> 'fieldId', 'electronicAccess', 'electronic.access', 'q') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%electronicAccess%' THEN regexp_replace(transformations.value ->> 'fieldId', 'electronicAccess', 'electronic.access', 'q') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb(LOWER(transformations.value ->> 'fieldId')))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb(LOWER(transformations.value ->> 'fieldId')))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{path}', to_jsonb( CASE WHEN transformations.value ->> 'recordType' = 'ITEM' AND transformations.value ->> 'path' NOT LIKE '%holdings[*]%' THEN regexp_replace(transformations.value ->> 'path', '$.', '$.holdings[*].', 'q') ELSE transformations.value ->> 'path' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{path}', to_jsonb( CASE WHEN transformations.value ->> 'recordType' = 'ITEM' AND transformations.value ->> 'path' NOT LIKE '%holdings[*]%' THEN regexp_replace(transformations.value ->> 'path', '$.', '$.holdings[*].', 'q') ELSE transformations.value ->> 'path' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%linktext' THEN regexp_replace(transformations.value ->> 'fieldId', 'linktext', 'linktext.default') WHEN transformations.value ->> 'fieldId' LIKE '%uri' THEN regexp_replace(transformations.value ->> 'fieldId', 'uri', 'uri.default') WHEN transformations.value ->> 'fieldId' LIKE '%materialsspecification' THEN regexp_replace(transformations.value ->> 'fieldId', 'materialsspecification', 'materialsspecification.default') WHEN transformations.value ->> 'fieldId' LIKE '%publicnote' THEN regexp_replace(transformations.value ->> 'fieldId', 'publicnote', 'publicnote.default') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%linktext' THEN regexp_replace(transformations.value ->> 'fieldId', 'linktext', 'linktext.default') WHEN transformations.value ->> 'fieldId' LIKE '%uri' THEN regexp_replace(transformations.value ->> 'fieldId', 'uri', 'uri.default') WHEN transformations.value ->> 'fieldId' LIKE '%materialsspecification' THEN regexp_replace(transformations.value ->> 'fieldId', 'materialsspecification', 'materialsspecification.default') WHEN transformations.value ->> 'fieldId' LIKE '%publicnote' THEN regexp_replace(transformations.value ->> 'fieldId', 'publicnote', 'publicnote.default') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{path}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%default' and transformations.value ->> 'path' LIKE '%electronicAccess[*]%' THEN regexp_replace(transformations.value ->> 'path', 'electronicAccess[*]', 'electronicAccess[?(!(@.relationshipId) || @.relationshipId == null)]', 'q') ELSE transformations.value ->> 'path' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{path}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%default' and transformations.value ->> 'path' LIKE '%electronicAccess[*]%' THEN regexp_replace(transformations.value ->> 'path', 'electronicAccess[*]', 'electronicAccess[?(!(@.relationshipId) || @.relationshipId == null)]', 'q') ELSE transformations.value ->> 'path' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%permanentlocationid' THEN regexp_replace(transformations.value ->> 'fieldId', 'permanentlocationid', 'permanentlocation.name', 'q') WHEN transformations.value ->> 'fieldId' LIKE '%temporarylocationid' THEN regexp_replace(transformations.value ->> 'fieldId', 'temporarylocationid', 'temporarylocation.name', 'q') WHEN transformations.value ->> 'fieldId' LIKE '%effectivelocationid' THEN regexp_replace(transformations.value ->> 'fieldId', 'effectivelocationid', 'effectivelocation.name', 'q') WHEN transformations.value ->> 'recordType' = 'ITEM' AND transformations.value ->> 'fieldId' LIKE '%effectivecallnumbercomponents.callnumber%' THEN regexp_replace(transformations.value ->> 'fieldId', 'effectivecallnumbercomponents.callnumber', 'callnumber', 'q') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles as profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(jsonb_set(transformations.value, '{fieldId}', to_jsonb( CASE WHEN transformations.value ->> 'fieldId' LIKE '%permanentlocationid' THEN regexp_replace(transformations.value ->> 'fieldId', 'permanentlocationid', 'permanentlocation.name', 'q') WHEN transformations.value ->> 'fieldId' LIKE '%temporarylocationid' THEN regexp_replace(transformations.value ->> 'fieldId', 'temporarylocationid', 'temporarylocation.name', 'q') WHEN transformations.value ->> 'fieldId' LIKE '%effectivelocationid' THEN regexp_replace(transformations.value ->> 'fieldId', 'effectivelocationid', 'effectivelocation.name', 'q') WHEN transformations.value ->> 'recordType' = 'ITEM' AND transformations.value ->> 'fieldId' LIKE '%effectivecallnumbercomponents.callnumber%' THEN regexp_replace(transformations.value ->> 'fieldId', 'effectivecallnumbercomponents.callnumber', 'callnumber', 'q') ELSE transformations.value ->> 'fieldId' END ))) FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY id )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.error_logs as errorLogs SET jsonb = jsonb_set(jsonb, '{errorMessageCode}', '"error.messagePlaceholder"') WHERE errorLogs.jsonb ->> 'reason' IS NOT null; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.error_logs as errorLogs SET jsonb = jsonb_set(jsonb, '{errorMessageCode}', '"error.messagePlaceholder"') WHERE errorLogs.jsonb ->> 'reason' IS NOT null; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.error_logs as errorLogs SET jsonb = jsonb_set(jsonb #- '{reason}', '{errorMessageValues}', jsonb_build_array(jsonb -> 'reason')) WHERE errorLogs.jsonb ->> 'reason' IS NOT null; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.error_logs as errorLogs SET jsonb = jsonb_set(jsonb #- '{reason}', '{errorMessageValues}', jsonb_build_array(jsonb -> 'reason')) WHERE errorLogs.jsonb ->> 'reason' IS NOT null; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles AS profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(transformations.value - 'hasSameTagInItems') FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY jsonb )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles AS profiles SET jsonb = jsonb_set(jsonb, '{transformations}', ( SELECT jsonb_agg(transformations.value - 'hasSameTagInItems') FROM testtenant_mod_data_export.mapping_profiles, jsonb_array_elements(jsonb -> 'transformations') AS transformations WHERE testtenant_mod_data_export.mapping_profiles.id = profiles.id GROUP BY jsonb )) WHERE profiles.jsonb ->> 'transformations' IS NOT null AND jsonb_array_length(profiles.jsonb -> 'transformations') > 0; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_profiles SET jsonb = jsonb || '{"name":"Default instances export job profile"}'::jsonb || '{"description":"Default instances export job profile"}'::jsonb WHERE id = '6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_profiles SET jsonb = jsonb || '{"name":"Default instances export job profile"}'::jsonb || '{"description":"Default instances export job profile"}'::jsonb WHERE id = '6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'true') WHERE id = '5e9835fc-0e51-44c8-8a47-f7b8fce35da7' OR id = '6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'true') WHERE id = '5e9835fc-0e51-44c8-8a47-f7b8fce35da7' OR id = '6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.job_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'false') WHERE id != '5e9835fc-0e51-44c8-8a47-f7b8fce35da7' AND id != '6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.job_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'false') WHERE id != '5e9835fc-0e51-44c8-8a47-f7b8fce35da7' AND id != '6f7f3cd7-9f24-42eb-ae91-91af1cd54d0a'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'true') WHERE id = '1ef7d0ac-f0a8-42b5-bbbb-c7e249009c13' OR id = '25d81cbe-9686-11ea-bb37-0242ac130002'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'true') WHERE id = '1ef7d0ac-f0a8-42b5-bbbb-c7e249009c13' OR id = '25d81cbe-9686-11ea-bb37-0242ac130002'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.mapping_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'false') WHERE id != '1ef7d0ac-f0a8-42b5-bbbb-c7e249009c13' AND id != '25d81cbe-9686-11ea-bb37-0242ac130002'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.mapping_profiles SET jsonb = jsonb_set(jsonb, '{default}', 'false') WHERE id != '1ef7d0ac-f0a8-42b5-bbbb-c7e249009c13' AND id != '25d81cbe-9686-11ea-bb37-0242ac130002'; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ DECLARE aname TEXT; BEGIN FOR aname IN SELECT name FROM testtenant_mod_data_export.rmb_internal_index WHERE remove = TRUE LOOP EXECUTE 'DROP INDEX IF EXISTS ' || aname; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ DECLARE aname TEXT; BEGIN FOR aname IN SELECT name FROM testtenant_mod_data_export.rmb_internal_index WHERE remove = TRUE LOOP EXECUTE 'DROP INDEX IF EXISTS ' || aname; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ DECLARE version TEXT; i RECORD; newindexdef TEXT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM testtenant_mod_data_export.rmb_internal; IF version !~ '^(\d\.|1\d\.|2[0-8]\.|29\.[0-3]\.)' THEN -- skip this upgrade if last install/upgrade was made by RMB >= 29.4.x RETURN; END IF; FOR i IN SELECT * FROM pg_catalog.pg_indexes WHERE schemaname = 'testtenant_mod_data_export' LOOP newindexdef := regexp_replace(i.indexdef, -- \m = beginning of a word, \M = end of a word '\mpublic\.(f_unaccent|concat_space_sql|concat_array_object_values|concat_array_object)\M', 'testtenant_mod_data_export.\1', 'g'); IF newindexdef <> i.indexdef THEN EXECUTE 'DROP INDEX ' || i.indexname; EXECUTE newindexdef; EXECUTE 'INSERT INTO rmb_internal_analyze VALUES ($1)' USING i.tablename; END IF; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ DECLARE version TEXT; i RECORD; newindexdef TEXT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM testtenant_mod_data_export.rmb_internal; IF version !~ '^(\d\.|1\d\.|2[0-8]\.|29\.[0-3]\.)' THEN -- skip this upgrade if last install/upgrade was made by RMB >= 29.4.x RETURN; END IF; FOR i IN SELECT * FROM pg_catalog.pg_indexes WHERE schemaname = 'testtenant_mod_data_export' LOOP newindexdef := regexp_replace(i.indexdef, -- \m = beginning of a word, \M = end of a word '\mpublic\.(f_unaccent|concat_space_sql|concat_array_object_values|concat_array_object)\M', 'testtenant_mod_data_export.\1', 'g'); IF newindexdef <> i.indexdef THEN EXECUTE 'DROP INDEX ' || i.indexname; EXECUTE newindexdef; EXECUTE 'INSERT INTO rmb_internal_analyze VALUES ($1)' USING i.tablename; END IF; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} DO $$ DECLARE t TEXT; BEGIN FOR t IN SELECT DISTINCT tablename FROM rmb_internal_analyze LOOP EXECUTE 'ANALYZE ' || t; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed DO $$ DECLARE t TEXT; BEGIN FOR t IN SELECT DISTINCT tablename FROM rmb_internal_analyze LOOP EXECUTE 'ANALYZE ' || t; END LOOP; END $$; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} TRUNCATE rmb_internal_analyze; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed TRUNCATE rmb_internal_analyze; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA testtenant_mod_data_export TO testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA testtenant_mod_data_export TO testtenant_mod_data_export; 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient trying to execute: {} UPDATE testtenant_mod_data_export.rmb_internal SET jsonb = jsonb || jsonb_build_object( 'rmbVersion', '35.0.1', 'moduleVersion', 'mod-data-export-4.7.1', 'schemaJson', $mainftl${ "tables": [ { "tableName": "file_definitions", "fromModuleVersion": "mod-data-export-1.1.1", "withMetadata": true, "withAuditing": false, "customSnippetPath": "custom_snippets/job_execution_sequence.sql" }, { "tableName": "mapping_profiles", "fromModuleVersion": "mod-data-export-2.1.0", "withMetadata": true, "withAuditing": false, "uniqueIndex": [{ "fieldName": "name" } ] }, { "tableName": "job_profiles", "fromModuleVersion": "mod-data-export-2.1.0", "withMetadata": true, "withAuditing": false, "foreignKeys": [ { "fieldName": "mappingProfileId", "targetTable": "mapping_profiles", "tOps": "ADD" } ], "uniqueIndex": [{ "fieldName": "name" } ] }, { "tableName" : "job_executions", "fromModuleVersion": "mod-data-export-2.1.0", "withAuditing": false, "index": [{ "fieldName" : "status", "tOps": "DELETE" } ], "fullTextIndex": [{ "fieldName" : "status", "tOps": "ADD" } ], "uniqueIndex": [{ "fieldName": "hrId" } ], "foreignKeys": [ { "fieldName": "jobProfileId", "targetTable": "job_profiles", "tOps": "ADD" } ] }, { "tableName": "error_logs", "fromModuleVersion": "mod-data-export-2.2.0", "withMetadata": true, "withAuditing": false, "foreignKeys": [ { "fieldName": "jobProfileId", "targetTable": "job_profiles", "tOps": "ADD" } ] } ], "scripts": [ { "run": "after", "snippetPath": "migration_scripts/rename_progress_current_to_exported.sql", "fromModuleVersion": "mod-data-export-2.0.0" }, { "run": "after", "snippetPath": "migration_scripts/add_job_profile_id.sql", "fromModuleVersion": "mod-data-export-2.1.0" }, { "run": "after", "snippetPath": "migration_scripts/rename_job_statuses.sql", "fromModuleVersion": "mod-data-export-2.2.0" }, { "run": "after", "snippetPath": "migration_scripts/add_last_updated_date_to_job.sql", "fromModuleVersion": "mod-data-export-2.2.0" }, { "run": "after", "snippetPath": "migration_scripts/change_progress_total_data_type.sql", "fromModuleVersion": "mod-data-export-3.1.0" }, { "run": "after", "snippetPath": "migration_scripts/remove_hasSameTagInHoldings.sql", "fromModuleVersion": "mod-data-export-3.0.2" }, { "run": "after", "snippetPath": "migration_scripts/update_transformations_mapping_profile.sql", "fromModuleVersion": "mod-data-export-3.0.2" }, { "run": "after", "snippetPath": "migration_scripts/migrate_error_log_reason_to_errorMessageCode.sql", "fromModuleVersion": "mod-data-export-3.1.0" }, { "run": "after", "snippetPath": "migration_scripts/remove_hasSameTagInItems.sql", "fromModuleVersion": "mod-data-export-3.1.0" }, { "run": "after", "snippetPath": "migration_scripts/rename_default_job_profile.sql", "fromModuleVersion": "mod-data-export-4.3.0" }, { "run": "after", "snippetPath": "migration_scripts/update_job_profile_default_value.sql", "fromModuleVersion": "mod-data-export-4.5.1" }, { "run": "after", "snippetPath": "migration_scripts/update_mapping_profile_default_value.sql", "fromModuleVersion": "mod-data-export-4.5.1" } ] } $mainftl$); 13:23:11 [] [testtenant] [] [mod_data_export] INFO PostgresClient Successfully executed UPDATE testtenant_mod_data_export.rmb_internal SET jsonb = jsonb || jsonb_build_object( 'rmbVersion', '35.0.1', 'moduleVersion', 'mod-data-export-4.7.1', 'schemaJson', $mainftl${ "tables": [ { "tableName": "file_definitions", "fromModuleVersion": "mod-data-export-1.1.1", "withMetadata": true, "withAuditing": false, "customSnippetPath": "custom_snippets/job_execution_sequence.sql" }, { "tableName": "mapping_profiles", "fromModuleVersion": "mod-data-export-2.1.0", "withMetadata": true, "withAuditing": false, "uniqueIndex": [{ "fieldName": "name" } ] }, { "tableName": "job_profiles", "fromModuleVersion": "mod-data-export-2.1.0", "withMetadata": true, "withAuditing": false, "foreignKeys": [ { "fieldName": "mappingProfileId", "targetTable": "mapping_profiles", "tOps": "ADD" } ], "uniqueIndex": [{ "fieldName": "name" } ] }, { "tableName" : "job_executions", "fromModuleVersion": "mod-data-export-2.1.0", "withAuditing": false, "index": [{ "fieldName" : "status", "tOps": "DELETE" } ], "fullTextIndex": [{ "fieldName" : "status", "tOps": "ADD" } ], "uniqueIndex": [{ "fieldName": "hrId" } ], "foreignKeys": [ { "fieldName": "jobProfileId", "targetTable": "job_profiles", "tOps": "ADD" } ] }, { "tableName": "error_logs", "fromModuleVersion": "mod-data-export-2.2.0", "withMetadata": true, "withAuditing": false, "foreignKeys": [ { "fieldName": "jobProfileId", "targetTable": "job_profiles", "tOps": "ADD" } ] } ], "scripts": [ { "run": "after", "snippetPath": "migration_scripts/rename_progress_current_to_exported.sql", "fromModuleVersion": "mod-data-export-2.0.0" }, { "run": "after", "snippetPath": "migration_scripts/add_job_profile_id.sql", "fromModuleVersion": "mod-data-export-2.1.0" }, { "run": "after", "snippetPath": "migration_scripts/rename_job_statuses.sql", "fromModuleVersion": "mod-data-export-2.2.0" }, { "run": "after", "snippetPath": "migration_scripts/add_last_updated_date_to_job.sql", "fromModuleVersion": "mod-data-export-2.2.0" }, { "run": "after", "snippetPath": "migration_scripts/change_progress_total_data_type.sql", "fromModuleVersion": "mod-data-export-3.1.0" }, { "run": "after", "snippetPath": "migration_scripts/remove_hasSameTagInHoldings.sql", "fromModuleVersion": "mod-data-export-3.0.2" }, { "run": "after", "snippetPath": "migration_scripts/update_transformations_mapping_profile.sql", "fromModuleVersion": "mod-data-export-3.0.2" }, { "run": "after", "snippetPath": "migration_scripts/migrate_error_log_reason_to_errorMessageCode.sql", "fromModuleVersion": "mod-data-export-3.1.0" }, { "run": "after", "snippetPath": "migration_scripts/remove_hasSameTagInItems.sql", "fromModuleVersion": "mod-data-export-3.1.0" }, { "run": "after", "snippetPath": "migration_scripts/rename_default_job_profile.sql", "fromModuleVersion": "mod-data-export-4.3.0" }, { "run": "after", "snippetPath": "migration_scripts/update_job_profile_default_value.sql", "fromModuleVersion": "mod-data-export-4.5.1" }, { "run": "after", "snippetPath": "migration_scripts/update_mapping_profile_default_value.sql", "fromModuleVersion": "mod-data-export-4.5.1" } ] } $mainftl$); 13:23:11 [] [testtenant] [] [mod_data_export] INFO TenantReferenceAPI postTenant 13:23:11 [] [testtenant] [] [mod_data_export] WARN TenantLoading TenantLoading.perform No X-Okapi-Url-to header 13:23:12 [] [testtenant] [] [mod_data_export] INFO RestRouting invoking postDataExportMappingProfiles 13:23:12 [] [testtenant] [] [mod_data_export] INFO LoadConfs Loading File: /tmp/postgres-conf.json 13:23:12 [] [testtenant] [] [mod_data_export] INFO PostgresClient Using schema: testtenant 13:23:12 [] [testtenant] [] [mod_data_export] INFO PostgresClient postgreSQLClientConfig = {"host":"localhost","port":5432,"username":"testtenant_mod_data_export","password":"...","database":"folio","postgres_tester":false} 13:23:12 [] [testtenant] [] [mod_data_export] INFO RestRouting invoking postDataExportMappingProfiles 13:23:12 [] [testtenant] [] [mod_data_export] INFO RestRouting invoking postDataExportMappingProfiles 13:23:12 [] [testtenant] [] [mod_data_export] INFO LogUtil 127.0.0.1:52528 POST /data-export/mapping-profiles null HTTP_1_1 201 519 43 tid=testtenant Created 13:23:12 [] [testtenant] [] [mod_data_export] INFO LogUtil 127.0.0.1:52527 POST /data-export/mapping-profiles null HTTP_1_1 201 524 47 tid=testtenant Created 13:23:12 [] [testtenant] [] [mod_data_export] INFO LogUtil 127.0.0.1:52526 POST /data-export/mapping-profiles null HTTP_1_1 201 524 89 tid=testtenant Created 13:23:12 [] [testtenant] [] [mod_data_export] INFO RestRouting invoking postDataExportJobProfiles 13:23:12 [] [testtenant] [] [mod_data_export] INFO RestRouting invoking postDataExportJobProfiles 13:23:12 [] [testtenant] [] [mod_data_export] INFO RestRouting invoking postDataExportJobProfiles 13:23:12 [] [testtenant] [] [mod_data_export] INFO LogUtil 127.0.0.1:52526 POST /data-export/job-profiles null HTTP_1_1 201 505 9 tid=testtenant Created 13:23:12 [] [testtenant] [] [mod_data_export] INFO LogUtil 127.0.0.1:52527 POST /data-export/job-profiles null HTTP_1_1 201 514 14 tid=testtenant Created 13:23:12 [] [testtenant] [] [mod_data_export] INFO LogUtil 127.0.0.1:52528 POST /data-export/job-profiles null HTTP_1_1 201 507 30 tid=testtenant Created 13:23:12 [] [testtenant] [] [mod_data_export] INFO TenantAPI job 01091e89-84f7-41dc-b582-c4afab840cdb completed