exec java -XX:MaxRAMPercentage=66.0 -XX:+ExitOnOutOfMemoryError -cp . -jar /usr/verticles/mod-invoice-fat.jar starting rest verticle service.......... 05:41:44 [] [] [] [] INFO RestVerticle git: https://github.com/folio-org/raml-module-builder.git 738443a7e0cd6abe9fe25c01521656d3e9d0d8b4 05:41:44 [] [] [] [] INFO RestVerticle metrics enabled: false 05:41:44 [] [] [] [] INFO Messages Loading messages from /infra-messages/APIMessages_en.properties ................................ 05:41:44 [] [] [] [] INFO Messages Loading messages from /infra-messages/APIMessages_de.properties ................................ 05:41:44 [] [] [] [] INFO Version HV000001: Hibernate Validator null 05:41:45 [] [] [] [] INFO RestRouting Adding route DELETE /admin/kill_query -> deleteAdminKillQuery 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/cache_hit_rates -> getAdminCacheHitRates 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/db_cache_summary -> getAdminDbCacheSummary 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/health -> getAdminHealth 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/jstack -> getAdminJstack 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /admin/jstack -> putAdminJstack 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/list_locking_queries -> getAdminListLockingQueries 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/loglevel -> getAdminLoglevel 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /admin/loglevel -> putAdminLoglevel 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/memory -> getAdminMemory 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_active_sessions -> getAdminPostgresActiveSessions 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_load -> getAdminPostgresLoad 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_table_access_stats -> getAdminPostgresTableAccessStats 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/postgres_table_size -> getAdminPostgresTableSize 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/slow_queries -> getAdminSlowQueries 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/table_index_usage -> getAdminTableIndexUsage 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /admin/total_db_size -> getAdminTotalDbSize 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /admin/get_password -> postAdminGetPassword 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /admin/importSQL -> postAdminImportSQL 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /admin/postgres_maintenance -> postAdminPostgresMaintenance 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /admin/set_AES_key -> postAdminSetAESKey 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /admin/postgres_create_indexes -> putAdminPostgresCreateIndexes 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /admin/postgres_drop_indexes -> putAdminPostgresDropIndexes 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /batch-voucher/batch-vouchers/{id} -> getBatchVoucherBatchVouchersById 05:41:45 [] [] [] [] INFO RestRouting Looks like org.folio.rest.jaxrs.resource.DataImportProfiles is not implemented 05:41:45 [] [] [] [] INFO RestRouting Adding route DELETE /_/tenant/{operation_id} -> deleteTenantByOperationId 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /_/tenant/{operation_id} -> getTenantByOperationId 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /_/tenant -> postTenant 05:41:45 [] [] [] [] INFO RestRouting Looks like org.folio.rest.jaxrs.resource.Configurations is not implemented 05:41:45 [] [] [] [] INFO RestRouting Adding route DELETE /batch-voucher/export-configurations/{id} -> deleteBatchVoucherExportConfigurationsById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /batch-voucher/export-configurations/{id} -> getBatchVoucherExportConfigurationsById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /batch-voucher/export-configurations/{id} -> putBatchVoucherExportConfigurationsById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /batch-voucher/export-configurations -> getBatchVoucherExportConfigurations 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /batch-voucher/export-configurations -> postBatchVoucherExportConfigurations 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /batch-voucher/export-configurations/{id}/credentials -> getBatchVoucherExportConfigurationsCredentialsById 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /batch-voucher/export-configurations/{id}/credentials -> postBatchVoucherExportConfigurationsCredentialsById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /batch-voucher/export-configurations/{id}/credentials -> putBatchVoucherExportConfigurationsCredentialsById 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /batch-voucher/export-configurations/{id}/credentials/test -> postBatchVoucherExportConfigurationsCredentialsTestById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /_/ramls -> getRamls 05:41:45 [] [] [] [] INFO RestRouting Adding route DELETE /invoice/invoice-lines/{id} -> deleteInvoiceInvoiceLinesById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoice-lines/{id} -> getInvoiceInvoiceLinesById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /invoice/invoice-lines/{id} -> putInvoiceInvoiceLinesById 05:41:45 [] [] [] [] INFO RestRouting Adding route DELETE /invoice/invoices/{id} -> deleteInvoiceInvoicesById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoices/{id} -> getInvoiceInvoicesById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /invoice/invoices/{id} -> putInvoiceInvoicesById 05:41:45 [] [] [] [] INFO RestRouting Adding route DELETE /invoice/invoices/{id}/documents/{documentId} -> deleteInvoiceInvoicesDocumentsByIdAndDocumentId 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoices/{id}/documents/{documentId} -> getInvoiceInvoicesDocumentsByIdAndDocumentId 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoice-lines -> getInvoiceInvoiceLines 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /invoice/invoice-lines -> postInvoiceInvoiceLines 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoice-number -> getInvoiceInvoiceNumber 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoices -> getInvoiceInvoices 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /invoice/invoices -> postInvoiceInvoices 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoices/{id}/documents -> getInvoiceInvoicesDocumentsById 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /invoice/invoices/{id}/documents -> postInvoiceInvoicesDocumentsById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /invoice/invoices/{id}/fiscal-years -> getInvoiceInvoicesFiscalYearsById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /invoice/invoice-lines/fund-distributions/validate -> putInvoiceInvoiceLinesFundDistributionsValidate 05:41:45 [] [] [] [] INFO RestRouting Looks like org.folio.rest.jaxrs.resource.FieldProtectionSettings is not implemented 05:41:45 [] [] [] [] INFO RestRouting Looks like org.folio.rest.jaxrs.resource.ConverterStorageFormsConfigs is not implemented 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /voucher/voucher-lines -> getVoucherVoucherLines 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /voucher/voucher-lines/{id} -> getVoucherVoucherLinesById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /voucher/voucher-lines/{id} -> putVoucherVoucherLinesById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /voucher/voucher-number/start -> getVoucherVoucherNumberStart 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /voucher/vouchers -> getVoucherVouchers 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /voucher/vouchers/{id} -> getVoucherVouchersById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /voucher/vouchers/{id} -> putVoucherVouchersById 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /voucher/voucher-number/start/{value} -> postVoucherVoucherNumberStartByValue 05:41:45 [] [] [] [] INFO RestRouting Adding route DELETE /batch-voucher/batch-voucher-exports/{id} -> deleteBatchVoucherBatchVoucherExportsById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /batch-voucher/batch-voucher-exports/{id} -> getBatchVoucherBatchVoucherExportsById 05:41:45 [] [] [] [] INFO RestRouting Adding route PUT /batch-voucher/batch-voucher-exports/{id} -> putBatchVoucherBatchVoucherExportsById 05:41:45 [] [] [] [] INFO RestRouting Adding route GET /batch-voucher/batch-voucher-exports -> getBatchVoucherBatchVoucherExports 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /batch-voucher/batch-voucher-exports -> postBatchVoucherBatchVoucherExports 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /batch-voucher/batch-voucher-exports/scheduled -> postBatchVoucherBatchVoucherExportsScheduled 05:41:45 [] [] [] [] INFO RestRouting Adding route POST /batch-voucher/batch-voucher-exports/{id}/upload -> postBatchVoucherBatchVoucherExportsUploadById 05:41:46 [] [] [] [] INFO RestRouting Adding route GET /_/jsonSchemas -> getJsonSchemas 05:41:46 [] [] [] [] INFO RestRouting Adding route DELETE /batch-groups/{id} -> deleteBatchGroupsById 05:41:46 [] [] [] [] INFO RestRouting Adding route GET /batch-groups/{id} -> getBatchGroupsById 05:41:46 [] [] [] [] INFO RestRouting Adding route PUT /batch-groups/{id} -> putBatchGroupsById 05:41:46 [] [] [] [] INFO RestRouting Adding route GET /batch-groups -> getBatchGroups 05:41:46 [] [] [] [] INFO RestRouting Adding route POST /batch-groups -> postBatchGroups 05:41:46 [] [] [] [] INFO RestRouting Looks like org.folio.rest.jaxrs.resource.Rmbtests is not implemented 05:41:46 [] [] [] [] INFO RestVerticle Init hook called with implemented class named org.folio.rest.impl.InitAPIs 05:41:46 [] [] [] [] INFO SpringContextUtil init:: defaultConfiguration != null 05:41:46 [] [] [] [] WARN ocalVariableTableParameterNameDiscoverer Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.folio.spring.SpringContextUtil$ObjectReferenceFactoryBean 05:41:46 [] [] [] [] WARN ocalVariableTableParameterNameDiscoverer Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.folio.dataimport.cache.JobProfileSnapshotCache 05:41:46 [] [] [] [] WARN ocalVariableTableParameterNameDiscoverer Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.folio.dataimport.handlers.events.DataImportKafkaHandler 05:41:46 [] [] [] [] WARN ocalVariableTableParameterNameDiscoverer Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.folio.config.ServicesConfiguration 05:41:47 [] [] [] [] WARN ocalVariableTableParameterNameDiscoverer Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.folio.services.invoice.BaseInvoiceService 05:41:47 [] [] [] [] WARN ocalVariableTableParameterNameDiscoverer Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.folio.invoices.events.handlers.BatchVoucherProcessHandler Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadRemoteDataLoaderService execute INFO: The exchange rate with resourceId IMFHistoricRateProvider was started remotely Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadRemoteDataLoaderService execute INFO: The exchange rate with resourceId ECBHistoric90RateProvider was started remotely Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadRemoteDataLoaderService execute INFO: The exchange rate with resourceId IMFRateProvider was started remotely Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadRemoteDataLoaderService execute INFO: The exchange rate with resourceId ECBCurrentRateProvider was started remotely Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: Read data from: [] Jan 24, 2024 5:41:47 AM org.javamoney.moneta.convert.imf.IMFAbstractRateProvider newDataLoaded INFO: Loaded IMFRateProvider exchange rates for days:50 Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: New data successfully loaded from: [] Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: Read data from: [] Jan 24, 2024 5:41:47 AM org.javamoney.moneta.convert.imf.IMFAbstractRateProvider newDataLoaded INFO: Loaded IMFHistoricRateProvider exchange rates for days:50 Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: New data successfully loaded from: [] Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: Read data from: [https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml] 05:41:47 [] [] [] [] INFO InitAPIs Available currency rates providers [ECB-HIST90, IMF, IDENT, ECB-HIST, ECB, IMF-HIST] Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: Read data from: [] 05:41:47 [] [] [] [] WARN ocalVariableTableParameterNameDiscoverer Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.folio.verticles.DataImportConsumerVerticle Jan 24, 2024 5:41:47 AM org.javamoney.moneta.convert.ecb.ECBAbstractRateProvider newDataLoaded INFO: Loaded ECBCurrentRateProvider exchange rates for days:1 Jan 24, 2024 5:41:47 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: New data successfully loaded from: [https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml] 05:41:48 [] [] [] [] INFO DataImportConsumerVerticle Kafka config: KafkaConfig(kafkaHost=10.36.1.31, kafkaPort=9092, okapiUrl=http://okapi:9130, replicationFactor=1, envId=FOLIO, maxRequestSize=4000000) Jan 24, 2024 5:41:48 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: Read data from: [] Jan 24, 2024 5:41:48 AM org.javamoney.moneta.convert.ecb.ECBAbstractRateProvider newDataLoaded INFO: Loaded ECBHistoric90RateProvider exchange rates for days:63 Jan 24, 2024 5:41:48 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: New data successfully loaded from: [] 05:41:48 [] [] [] [] INFO KafkaConsumerWrapper start:: Consumer created - id: 0 subscriptionPattern: SubscriptionDefinition(eventType=DI_INCOMING_EDIFACT_RECORD_PARSED, subscriptionPattern=FOLIO\.Default\.\w{1,}\.DI_INCOMING_EDIFACT_RECORD_PARSED) 05:41:48 [] [] [] [] INFO InitAPIs DataImportConsumerVerticle verticle was successfully started 05:41:48 [] [] [] [] INFO RestVerticle Listening port 8081 05:41:48 [] [] [] [] INFO RestVerticle No periodic implementation found, continuing with deployment 05:41:48 [] [] [] [] INFO RestVerticle Post Deploy Hook called with implemented class named org.folio.rest.impl.InitEventBus 05:41:48 [] [] [] [] INFO ? Succeeded in deploying verticle Jan 24, 2024 5:41:49 AM org.javamoney.moneta.convert.ecb.ECBAbstractRateProvider newDataLoaded INFO: Loaded ECBHistoricRateProvider exchange rates for days:4358 Jan 24, 2024 5:41:49 AM org.javamoney.moneta.spi.loader.LoadDataLoaderService execute INFO: New data successfully loaded from: [] 05:45:43 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO RestRouting invoking postTenant 05:45:43 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient DB config read from environment variables 05:45:43 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient postgreSQLClientConfig = {"maxPoolSize":5,"port":5432,"queryTimeout":60000,"username":"folio_admin","charset":"UTF-8","host":"10.36.1.31","database":"okapi_modules","password":"...","postgres_tester":false} 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Executing multiple statements with id 1189778553 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE ROLE diku_mod_invoice PASSWORD 'diku' NOSUPERUSER NOCREATEDB INHERIT LOGIN; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE ROLE diku_mod_invoice PASSWORD 'diku' NOSUPERUSER NOCREATEDB INHERIT LOGIN; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: GRANT diku_mod_invoice TO CURRENT_USER; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: GRANT diku_mod_invoice TO CURRENT_USER; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE SCHEMA diku_mod_invoice AUTHORIZATION diku_mod_invoice; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE SCHEMA diku_mod_invoice AUTHORIZATION diku_mod_invoice; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: ALTER ROLE diku_mod_invoice SET search_path = "diku_mod_invoice"; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: ALTER ROLE diku_mod_invoice SET search_path = "diku_mod_invoice"; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: DO $$ BEGIN -- use advisory lock, otherwise concurrent installs running -- 'CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public' -- in parallel may fail with -- 'ERROR: duplicate key value violates unique constraint "pg_extension_name_index" (23505)' -- https://github.com/greenplum-db/gpdb/issues/4601 PERFORM pg_advisory_xact_lock(20201101, 1234567890); 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; CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public; CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public; END $$; 05:45:44 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='42710', message='extension "unaccent" already exists, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='SQL statement "CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public" PL/pgSQL function inline_code_block line 23 at SQL statement', file='extension.c', line='1777', routine='CreateExtension', schema='null', table='null', column='null', dataType='null', constraint='null' 05:45:44 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='42710', message='extension "pg_trgm" already exists, skipping', detail='null', hint='null', position='null', internalPosition='null', internalQuery='null', where='SQL statement "CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public" PL/pgSQL function inline_code_block line 24 at SQL statement', file='extension.c', line='1777', routine='CreateExtension', schema='null', table='null', column='null', dataType='null', constraint='null' 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: DO $$ BEGIN -- use advisory lock, otherwise concurrent installs running -- 'CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public' -- in parallel may fail with -- 'ERROR: duplicate key value violates unique constraint "pg_extension_name_index" (23505)' -- https://github.com/greenplum-db/gpdb/issues/4601 PERFORM pg_advisory_xact_lock(20201101, 1234567890); 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; CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public; CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public; END $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS diku_mod_invoice.rmb_internal ( id SERIAL PRIMARY KEY, jsonb JSONB NOT NULL ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS diku_mod_invoice.rmb_internal ( id SERIAL PRIMARY KEY, jsonb JSONB NOT NULL ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: insert into diku_mod_invoice.rmb_internal (jsonb) values ('{"rmbVersion": "35.1.0", "moduleVersion": "mod-invoice-5.8.0-SNAPSHOT.399"}'::jsonb); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: insert into diku_mod_invoice.rmb_internal (jsonb) values ('{"rmbVersion": "35.1.0", "moduleVersion": "mod-invoice-5.8.0-SNAPSHOT.399"}'::jsonb); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS diku_mod_invoice.rmb_job ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS diku_mod_invoice.rmb_job ( id UUID PRIMARY KEY, jsonb JSONB NOT NULL ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO LogUtil 10.36.1.31:50948 POST /_/tenant null HTTP_1_1 201 422 1070 tid=diku Created 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Executing multiple statements with id -1730360972 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: SET search_path TO diku_mod_invoice; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: SET search_path TO diku_mod_invoice; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS diku_mod_invoice.rmb_internal_index ( name text PRIMARY KEY, def text NOT NULL, remove boolean NOT NULL ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS diku_mod_invoice.rmb_internal_index ( name text PRIMARY KEY, def text NOT NULL, remove boolean NOT NULL ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: UPDATE diku_mod_invoice.rmb_internal_index SET remove = TRUE; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: UPDATE diku_mod_invoice.rmb_internal_index SET remove = TRUE; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS rmb_internal_analyze ( tablename text ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS rmb_internal_analyze ( tablename text ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE AGGREGATE diku_mod_invoice.max(uuid) ( stype = uuid, sfunc = diku_mod_invoice.uuid_larger, combinefunc = diku_mod_invoice.uuid_larger, parallel = safe, sortop = operator (>) ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE AGGREGATE diku_mod_invoice.max(uuid) ( stype = uuid, sfunc = diku_mod_invoice.uuid_larger, combinefunc = diku_mod_invoice.uuid_larger, parallel = safe, sortop = operator (>) ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE AGGREGATE diku_mod_invoice.min(uuid) ( stype = uuid, sfunc = diku_mod_invoice.uuid_smaller, combinefunc = diku_mod_invoice.uuid_smaller, parallel = safe, sortop = operator (<) ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE AGGREGATE diku_mod_invoice.min(uuid) ( stype = uuid, sfunc = diku_mod_invoice.uuid_smaller, combinefunc = diku_mod_invoice.uuid_smaller, parallel = safe, sortop = operator (<) ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: DROP FUNCTION IF EXISTS diku_mod_invoice.count_estimate_smart2(bigint,bigint,text); 05:45:44 [] [] [] [] WARN ? Backend notice: severity='NOTICE', code='00000', message='function diku_mod_invoice.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' 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: DROP FUNCTION IF EXISTS diku_mod_invoice.count_estimate_smart2(bigint,bigint,text); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.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 = diku_mod_invoice.count_estimate_smart2(1000, 1000, query); IF rows < 1000 THEN return 1000; END IF; RETURN rows; END; $$ LANGUAGE plpgsql IMMUTABLE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.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 = diku_mod_invoice.count_estimate_smart2(1000, 1000, query); IF rows < 1000 THEN return 1000; END IF; RETURN rows; END; $$ LANGUAGE plpgsql IMMUTABLE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.count_estimate(query text) RETURNS bigint AS $$ DECLARE count bigint; est_count bigint; q text; BEGIN est_count = diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.count_estimate(query text) RETURNS bigint AS $$ DECLARE count bigint; est_count bigint; q text; BEGIN est_count = diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.upsert(text, uuid, anyelement) RETURNS uuid AS $$ DECLARE ret uuid; BEGIN EXECUTE format('UPDATE diku_mod_invoice.%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 diku_mod_invoice.%I (id, jsonb) VALUES ($2, $3) RETURNING id', $1) USING $1, $2, $3 INTO STRICT ret; RETURN ret; END; $$ LANGUAGE plpgsql; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.upsert(text, uuid, anyelement) RETURNS uuid AS $$ DECLARE ret uuid; BEGIN EXECUTE format('UPDATE diku_mod_invoice.%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 diku_mod_invoice.%I (id, jsonb) VALUES ($2, $3) RETURNING id', $1) USING $1, $2, $3 INTO STRICT ret; RETURN ret; END; $$ LANGUAGE plpgsql; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] 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 diku_mod_invoice.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 diku_mod_invoice.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 $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] 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 diku_mod_invoice.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 diku_mod_invoice.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 $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.get_tsvector(text) RETURNS tsvector AS $$ SELECT to_tsvector('simple', translate($1, '&', ',')); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.get_tsvector(text) RETURNS tsvector AS $$ SELECT to_tsvector('simple', translate($1, '&', ',')); $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.tsquery_or(text) RETURNS tsquery AS $$ SELECT replace(diku_mod_invoice.tsquery_and($1)::text, '&', '|')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.tsquery_or(text) RETURNS tsquery AS $$ SELECT replace(diku_mod_invoice.tsquery_and($1)::text, '&', '|')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.tsquery_phrase(text) RETURNS tsquery AS $$ SELECT replace(diku_mod_invoice.tsquery_and($1)::text, '&', '<->')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.tsquery_phrase(text) RETURNS tsquery AS $$ SELECT replace(diku_mod_invoice.tsquery_and($1)::text, '&', '<->')::tsquery; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE OR REPLACE FUNCTION diku_mod_invoice.set_id_in_jsonb() RETURNS TRIGGER AS $$ BEGIN NEW.jsonb = jsonb_set(NEW.jsonb, '{id}', to_jsonb(NEW.id)); RETURN NEW; END; $$ language 'plpgsql'; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE OR REPLACE FUNCTION diku_mod_invoice.set_id_in_jsonb() RETURNS TRIGGER AS $$ BEGIN NEW.jsonb = jsonb_set(NEW.jsonb, '{id}', to_jsonb(NEW.id)); RETURN NEW; END; $$ language 'plpgsql'; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: create or replace function diku_mod_invoice.concat_space_sql(VARIADIC text[]) RETURNS text AS $$ select concat_ws(' ', VARIADIC $1); $$ LANGUAGE SQL IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: create or replace function diku_mod_invoice.concat_space_sql(VARIADIC text[]) RETURNS text AS $$ select concat_ws(' ', VARIADIC $1); $$ LANGUAGE SQL IMMUTABLE PARALLEL SAFE STRICT; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: create or replace function diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: DROP FUNCTION IF EXISTS rmb_internal_index(aname text, tops text, newdef text); 05:45:44 [] [] [] [] 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' 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: DROP FUNCTION IF EXISTS rmb_internal_index(aname text, tops text, newdef text); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] 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 diku_mod_invoice.rmb_internal_index WHERE name = $1' USING aname; RETURN; END IF; SELECT def INTO olddef FROM diku_mod_invoice.rmb_internal_index WHERE name = aname; SELECT def INTO prepareddef FROM diku_mod_invoice.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 diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] 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 diku_mod_invoice.rmb_internal_index WHERE name = $1' USING aname; RETURN; END IF; SELECT def INTO olddef FROM diku_mod_invoice.rmb_internal_index WHERE name = aname; SELECT def INTO prepareddef FROM diku_mod_invoice.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 diku_mod_invoice.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; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: DO $$ BEGIN -- use advisory lock to prevent "tuple concurrently updated" -- https://issues.folio.org/browse/RMB-744 https://issues.folio.org/browse/RMB-944 PERFORM pg_advisory_xact_lock(20201101, 1234567890); REVOKE ALL PRIVILEGES ON SCHEMA public FROM diku_mod_invoice; REVOKE CREATE ON SCHEMA public FROM PUBLIC; END $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: DO $$ BEGIN -- use advisory lock to prevent "tuple concurrently updated" -- https://issues.folio.org/browse/RMB-744 https://issues.folio.org/browse/RMB-944 PERFORM pg_advisory_xact_lock(20201101, 1234567890); REVOKE ALL PRIVILEGES ON SCHEMA public FROM diku_mod_invoice; REVOKE CREATE ON SCHEMA public FROM PUBLIC; END $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: CREATE TABLE IF NOT EXISTS records_invoices ( record_id uuid NOT NULL PRIMARY KEY, invoice_id uuid NOT NULL, created_date timestamp DEFAULT CURRENT_TIMESTAMP ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: CREATE TABLE IF NOT EXISTS records_invoices ( record_id uuid NOT NULL PRIMARY KEY, invoice_id uuid NOT NULL, created_date timestamp DEFAULT CURRENT_TIMESTAMP ); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: DO $$ DECLARE aname TEXT; BEGIN FOR aname IN SELECT name FROM diku_mod_invoice.rmb_internal_index WHERE remove = TRUE LOOP EXECUTE 'DROP INDEX IF EXISTS ' || aname; END LOOP; END $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: DO $$ DECLARE aname TEXT; BEGIN FOR aname IN SELECT name FROM diku_mod_invoice.rmb_internal_index WHERE remove = TRUE LOOP EXECUTE 'DROP INDEX IF EXISTS ' || aname; END LOOP; END $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: DO $$ DECLARE version TEXT; i RECORD; newindexdef TEXT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM diku_mod_invoice.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 = 'diku_mod_invoice' 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', 'diku_mod_invoice.\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 $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: DO $$ DECLARE version TEXT; i RECORD; newindexdef TEXT; BEGIN SELECT jsonb->>'rmbVersion' INTO version FROM diku_mod_invoice.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 = 'diku_mod_invoice' 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', 'diku_mod_invoice.\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 $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] 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 $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] 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 $$; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: TRUNCATE rmb_internal_analyze; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: TRUNCATE rmb_internal_analyze; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA diku_mod_invoice TO diku_mod_invoice; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA diku_mod_invoice TO diku_mod_invoice; 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient trying to execute: UPDATE diku_mod_invoice.rmb_internal SET jsonb = jsonb || jsonb_build_object( 'rmbVersion', '35.1.0', 'moduleVersion', 'mod-invoice-5.8.0-SNAPSHOT.399', 'schemaJson', $mainftl${ "tables": [], "scripts": [ { "run": "after", "snippetPath": "create_records_invoices_table.sql", "fromModuleVersion": "mod-invoice-5.8.0" } ] }$mainftl$); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO PostgresClient Successfully executed: UPDATE diku_mod_invoice.rmb_internal SET jsonb = jsonb || jsonb_build_object( 'rmbVersion', '35.1.0', 'moduleVersion', 'mod-invoice-5.8.0-SNAPSHOT.399', 'schemaJson', $mainftl${ "tables": [], "scripts": [ { "run": "after", "snippetPath": "create_records_invoices_table.sql", "fromModuleVersion": "mod-invoice-5.8.0" } ] }$mainftl$); 05:45:44 [056475/proxy;955974/tenant] [diku] [] [mod_invoice] INFO TenantAPI job 79b15582-5087-42e7-851d-950b3c78ec42 completed