Re: foreign keys on multiple parent table

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Lorusso Domenico <domenico(dot)l76(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: foreign keys on multiple parent table
Date: 2023-06-20 20:50:48
Message-ID: CAKFQuwbo+wunJ7MaQHWxCMkrGu1DQUn2EqGJk_tTjg49FpzczQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday, June 20, 2023, Lorusso Domenico <domenico(dot)l76(at)gmail(dot)com> wrote:

>
> Could work, but is there a way to set a reference key over the uuid of all
> the tables?
>

A foreign key in PostgreSQL is between two, and only two, tables. The PK
side of which must be uniquely constrained.

You can write custom triggers if you need something other than this.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Les 2023-06-20 21:01:32 Re: foreign keys on multiple parent table
Previous Message Lorusso Domenico 2023-06-20 20:46:56 foreign keys on multiple parent table