Useful Command line actions

Task

Command line query

Steps / Explanation

I want to access logs from the datavault builder core engine

DO $$
  BEGIN
    TRUNCATE TABLE dvb_log.postgres_core_log;
    EXECUTE format('COPY dvb_log.postgres_core_log
    FROM %1$L WITH csv;',
      (SELECT 'log/' || name AS filename
      FROM pg_ls_logdir()
      WHERE name LIKE '%.csv'
      ORDER BY modification DESC LIMIT 1));
  END;
$$;
SELECT 'ok';
1. Run the query, which copies the log files into the core engine database.
2.a) If you have a postgres client to connect to the core, you can then directly access the table in the database.
2.b) Alternatively, you can connect the core as an own Source System in the staging table to load the logs.

I want to see a list of all existing users

SELECT string_agg(au.username, ',')
FROM dvb_core.auth_users au;

Alternatively, the list can also be seen by accessing the table dvb_config.auth_users on the processing database

I would like to make sure that a settings change in dvb_config.config is applied

SELECT dvb_core.f_refresh_x_relations();
Computing the data lineage is performance intensive and can take some time. Therefore, it is only initiated after changes and then cached. With this command, a refresh is initiated, which is then executed async in the background.

It seems like some created objects are not visible in the GUI.

SELECT dvb_core.f_refresh_all_base_views();

The core engine will refresh cached metadata based on the current implementation without the need for a restart.