A situation with one parent table and 3 child tables

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: A situation with one parent table and 3 child tables
Date: 2023-10-02 20:57:32
Message-ID: CAAY=A7_wHBKkKFxuxXc7A+fr3TYGmWS9-hCGghLRDcQAAa_wfQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I have one parent table (*table_p*) with 3 child tables (*table_ch1*,
*table_ch2
*and *table_ch3*). Each record of the parent table can be associated with 1
and only 1 child table records. This means that:

* Some records of the *table_p* will link to records of *table_ch1*
* Some records of the *table_p* will link to records of *table_ch2*
* Some records of the *table_p* will link to records of *table_ch3*

At first look, this does not make very much sense to me. I thought about
considering 3 parent tables, one for each child table. However, the 3
parent tables would have the same exact structure and I would like to know
if there is a workaround for this issue.

Thanks in advance.

Jorge Maldonado

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gareth Evans 2023-10-02 21:46:00 Re: A situation with one parent table and 3 child tables
Previous Message Andreas Joseph Krogh 2023-09-25 09:58:56 Sv: DDL in active production database