Project

General

Profile

Actions

Feature #7221

open

Referential integrity for database arrays

Added by Radko Krkoš about 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Low
Assignee:
Category:
Research and analysis
Target version:
Start date:
04/16/2021
Due date:
% Done:

0%

Estimated time:
To be discussed:
No

Description

A classic referential integrity model in relational databases is based on FOREIGN KEYs, implemented as REFERENCES in the PostgreSQL DB. This feature has several advantages, preventing irrecoverable errors in data and allowing CASCADE of data modification procedures.
The database system used currently does not support references for array values, which are used commonly in the Mentat database model and missing this feature caused several inconsistencies (albeit with minimum impact so far).
A workaround at the database level might be a using a TRIGGER, checking the data during all modifications. There are two paths that must be analyzed: INSERT/UPDATE to the referring array and INSERT/UPDATE/DELETE to the KEY column/table. Both should be doable using the RIGGER approach.
Things to consider:
- implementation feasibility,
- performance impact in all scenarios (read should not be affected, others must be analyzed),
- parametrisability/reusability (there are several such reference relations, with more to come).


Related issues

Related to Mentat - Bug #7215: Wrong usage of DB array in mentat_main/settings_reporting/emailsClosedRajmund Hruška04/15/2021

Actions
Related to Mentat - Bug #7220: Erroneous values in mentat_main/reports_events/mail_toClosedRajmund Hruška04/16/2021

Actions
Actions

Also available in: Atom PDF