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 1nobUO-0006ty-PF for pgsql-novice@arkaria.postgresql.org; Wed, 11 May 2022 01:50:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nobUN-0007A8-L7 for pgsql-novice@arkaria.postgresql.org; Wed, 11 May 2022 01:50:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nobUN-00079o-Cv for pgsql-novice@lists.postgresql.org; Wed, 11 May 2022 01:50:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nobUK-0006yU-SK for pgsql-novice@lists.postgresql.org; Wed, 11 May 2022 01:50:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 24B1o3UA039423; Tue, 10 May 2022 21:50:03 -0400 From: Tom Lane To: Simon Connah cc: pgsql-novice@lists.postgresql.org Subject: Re: Using "object orientated" tables? In-reply-to: References: Comments: In-reply-to Simon Connah message dated "Wed, 11 May 2022 01:33:20 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <39421.1652233803.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 10 May 2022 21:50:03 -0400 Message-ID: <39422.1652233803@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Simon Connah writes: > I was wondering what the community thought of using table inheritance in= PostgreSQL? Is it considered bad practice these days? Mmm ... not if the various caveats[1] don't bother you. The biggest stumbling block for most people, I think, is that you can't have foreign keys that reference the whole inheritance hierarchy. regards, tom lane [1] https://www.postgresql.org/docs/current/ddl-inherit.html#DDL-INHERIT-C= AVEATS