Skip to content

Scenario Log

Ludwig Hülk edited this page Feb 21, 2018 · 1 revision

The Scenario Log is a logging system for a PostgreSQL database.

It consists of two main elements: The Scenario Log Table and the Scenario Log Function.

The system has been created to track data (flows) in software that runs on a database server.

Scenario Log Table

The table is created once to get log entries.

Name Type Comment
id* serial Unique identifier (PK)
project text Project name
version text Scenario version (FK)
io text Input or output
schema_name text Schema name
table_name text Table name
script_name text Script name
entries* integer Number of rows
comment text Current status and comments
user_name* text Author (session user)
timestamp* timestamp Timestamp without time zone
meta_data* text Copy of the input metadata

All fields marked with (*) are retrieved from the server.

Scenario Log Function

The function is written in plpgsql and is called with scenario_log(text,text,text,text,text,text,text).

It has 7 inputs and 12 outputs (see table above).

-- scenario log (project,version,io,schema_name,table_name,script_name,comment)
SELECT scenario_log('eGo_PP','PP1','setup','model_draft','scenario_log','function_scenario_log.sql','Function testing');
Clone this wiki locally