Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsOEY-007q9V-KZ for pgsql-general@arkaria.postgresql.org; Mon, 16 Oct 2023 14:06:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qsOEW-001IeK-9K for pgsql-general@arkaria.postgresql.org; Mon, 16 Oct 2023 14:06:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsOEV-001Idj-V8 for pgsql-general@lists.postgresql.org; Mon, 16 Oct 2023 14:06:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsOEU-000lJP-42 for pgsql-general@lists.postgresql.org; Mon, 16 Oct 2023 14:06:11 +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 39GE65hu2289589; Mon, 16 Oct 2023 10:06:06 -0400 From: Tom Lane To: Christophe Pettus cc: Thiemo Kellner , pgsql-general@lists.postgresql.org Subject: Re: Purely declarative FKs In-reply-to: <60D62406-E176-4F93-B9B4-C1C6CFA66B84@thebuild.com> References: <589ff648-9774-d166-450e-74695ae77161@gelassene-pferde.biz> <60D62406-E176-4F93-B9B4-C1C6CFA66B84@thebuild.com> Comments: In-reply-to Christophe Pettus message dated "Mon, 16 Oct 2023 01:43:30 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2289587.1697465165.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 16 Oct 2023 10:06:05 -0400 Message-ID: <2289588.1697465165@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Christophe Pettus writes: > On Oct 16, 2023, at 00:51, Thiemo Kellner = wrote: >> Question: Are there plans to provide a feature in PostgreSQL that one >> can have foreign keys for purely documentation purpose - I know, one >> could use a modelling tool and just not implement the FKs, but my >> reality is, there is hardly ever a modelling tool involved. > The answer to the specific question is, no, I don't believe that there > any plans to implement purely documentary foreign keys. Recent versions of the SQL spec have a NOT ENFORCED option for constraints, which is what I think you're looking for here. If somebody came with a well-thought-out patch to add that feature, we'd likely take it. But this is definitely a "scratch your own itch" situation; I don't know of anyone already working on such a thing. regards, tom lane