Re: Composite type: Primary Key and validation - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Composite type: Primary Key and validation
Date
Msg-id CAHyXU0xnK=DrTc4veE3mW=o=vjKmHy_M+=NdxE3t03jk_ub7Xg@mail.gmail.com
Whole thread Raw
In response to Re: Composite type: Primary Key and validation  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
On Mon, Jun 5, 2023 at 12:08 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Mon, 2023-06-05 at 17:06 +0200, Lorusso Domenico wrote:
> A composite type is useful because I've to add all these information on many tables and because
> it more easy to pass all these informations to functions that have to ensure the right format and evaluation.
>
> Talking about first point I could use the "table inheritance", but I've to reset all constraints for each table :-(

Inheritance is actually a very good way to do this.
You don't inherit constraints, but at least the column definitions.

Agreed on not using composite type.

Another suggestion, this might be a good idea for range type.

merlin 

pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Composite type: Primary Key and validation
Next
From: Lorusso Domenico
Date:
Subject: Re: Composite type: Primary Key and validation