Re: Design database

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Mai Peng <maily(dot)peng(at)webedia-group(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Design database
Date: 2021-02-03 15:35:41
Message-ID: CAKFQuwYjH8proEfMJ7jnFo9k_6tABgOG=ib5TeEnTSjGMQmPqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Feb 3, 2021 at 8:23 AM Mai Peng <maily(dot)peng(at)webedia-group(dot)com>
wrote:

> Hello,
>
> I’ve got a table name publication, and another table named
> publication_item.
> Each publication_item is linked to a publication by publication_id.
> How could I add a constraint that check each publication has one or more
> publication_item when a tuple is inserted ?
> I don’t want to store items in the same table as publication because we
> could have 1-> n items.
>

https://www.postgresql.org/docs/current/tutorial-fk.html

David J.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Yambu 2021-02-03 15:53:30 pg_wal keeps growing
Previous Message Raj kumar 2021-02-03 15:32:42 Sharding in Postgres