foreign keys on multiple parent table - Mailing list pgsql-general

From Lorusso Domenico
Subject foreign keys on multiple parent table
Date
Msg-id CAJMpnG72qkzsg=OAULTrCqU20uY7ZU885aZCLUyL-35_1LJzwA@mail.gmail.com
Whole thread Raw
Responses Re: foreign keys on multiple parent table
Re: foreign keys on multiple parent table
Re: foreign keys on multiple parent table
List pgsql-general
Hello guys,
I've many tables representing as many concepts.

For each record of each table I need to store extra information (think to audit information, but more complex than a simple text)

The relation is 1:N, for each record there could be many audit records.

From programming point of view and also to reduce the number of objects in DB could be convinient create just an audit table with a structure like:
  • auditi id
  • reference_uuid (the key of the main table)
  • table_name
  • list of audit data
Could work, but is there a way to set a reference key over the uuid of all the tables?


--
Domenico L.

per stupire mezz'ora basta un libro di storia,
io cercai di imparare la Treccani a memoria... [F.d.A.]

pgsql-general by date:

Previous
From: Marc Millas
Date:
Subject: Re: pb with join plan
Next
From: "David G. Johnston"
Date:
Subject: Re: foreign keys on multiple parent table