Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6Dhr-0000lD-7i for pgsql-general@arkaria.postgresql.org; Mon, 05 Jun 2023 17:09:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q6Dgs-0002HO-0X for pgsql-general@arkaria.postgresql.org; Mon, 05 Jun 2023 17:08:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6Dgr-0002HF-GX for pgsql-general@lists.postgresql.org; Mon, 05 Jun 2023 17:08:21 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q6Dgp-000NWf-1k for pgsql-general@lists.postgresql.org; Mon, 05 Jun 2023 17:08:20 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9745c5fed21so604411766b.3 for ; Mon, 05 Jun 2023 10:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1685984897; x=1688576897; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=xFr2LiqnsumLXFKK6zBF6FhmUpas36FnmqcTbyzbh9A=; b=3V48zc/SnM6BQgvMEa+mGATo+t34Z41A2wUCylxmeromnlixBkkeNfPccy2ZGpTqQx 31eZi41V8Mr+C0fA/KZ6FwzNdtfMVbW8joVbb9ricvY2CwDDkO0pXXwfmRz8GKMTfJXB gFXjvCunGgNfXbVvVJFqxyjPqdTzQCalHFsKAht1hCW0alaz15fUzjS07hQMy7FAzuIy witkcWTaYk1VTMndVt9HPTgPgXIBZsXAjUwY8MvL7hWyHcR/EeiFErU7QDRXgztoHARN i5dph+Zc5ZYAf50bmrdqGdvaFd4EIwAGgDwjulLinLda0sOMcLRN4T0e37N5Q926AveY Wm6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685984897; x=1688576897; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xFr2LiqnsumLXFKK6zBF6FhmUpas36FnmqcTbyzbh9A=; b=l40cZ1AuXSgc9zMlj5aEV7FDVI0rryUtXptJlVWB5ptN+80mpT3ZgEn+7x0Jqtvpym XdXl0P2Qdfcj6uWVgsrWuAfBJUi1oZP8eYrWOFW9lw9ZioAAr6maDoGk0CGlIAx6caIK Jmdq5bvG8Cs21Am7weW0X2qg+TTdwIvS5LbNAUhjvIsfHsDpF2SLFZhxUSqSYGG8Z/VT GbwbwhVgNhrUQyq1s7fmSAlw8bXvaABf8U2y0Th+PaSHxX+gysY4YcxlPs9KrJqDkqhb 29y2fJ17ht1/Mqo1lSyWBd9jYgZq0ANspGf4VcNtuqryQrE0S7cdCHUr2gDev79DtFjH QLSA== X-Gm-Message-State: AC+VfDzr7RwRUZ/zPjrK5NzX1Zpf/qpSSivzkzLlNiWdsSbcQEZtrZPY vLmc7r/SQFdk4dWt9BvLB+ucmQ== X-Google-Smtp-Source: ACHHUZ7QeV5R+IVvONgaNOm5xrsSBlbbwMxcJgEe++zSDHUQsobcEAmu0ssvldwsPbg5Kd7tl9xT7w== X-Received: by 2002:a17:907:36cd:b0:974:4457:b6f with SMTP id bj13-20020a17090736cd00b0097444570b6fmr7125470ejc.23.1685984896861; Mon, 05 Jun 2023 10:08:16 -0700 (PDT) Received: from localhost.localdomain (178-190-178-66.adsl.highway.telekom.at. [178.190.178.66]) by smtp.gmail.com with ESMTPSA id d17-20020a1709061f5100b0097456b4085fsm4460996ejk.190.2023.06.05.10.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 10:08:16 -0700 (PDT) Message-ID: <9fc3538a8fbe1d3c1bacb3485bc669c9fbb3f993.camel@cybertec.at> Subject: Re: Composite type: Primary Key and validation From: Laurenz Albe To: Lorusso Domenico Cc: pgsql-general@lists.postgresql.org Date: Mon, 05 Jun 2023 19:08:15 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 m= any tables and because > it more easy to pass all these informations to functions that have to ens= ure the right format and evaluation. >=20 > Talking about first point I could use the "table inheritance", but I've t= o reset all constraints=C2=A0for each table :-( Inheritance is actually a very good way to do this. You don't inherit constraints, but at least the column definitions. Yours, Laurenz Albe