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.96) (envelope-from ) id 1whlcW-000PKO-2M for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Jul 2026 10:04:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whlcV-00CN9G-0o for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Jul 2026 10:04:39 +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.96) (envelope-from ) id 1whTWN-007YMC-1v for pgsql-bugs@lists.postgresql.org; Wed, 08 Jul 2026 14:45:08 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whTWL-00000000ANl-2Qdp for pgsql-bugs@lists.postgresql.org; Wed, 08 Jul 2026 14:45:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=67t0n//VjgwGsP5iAWFkuc0SQMK573pKRihdd5T9v0E=; b=jjG1oHyvFhphcx+Dfq3CIduqPK JRKgcYEB+VZ5410Kjjp2OiootpjuEG9G7V5+Y9aTfw8m0IuiQIoJ8gwvdD3cdBhUCdScsB4HRJJZC 58ejZ5F1ZBKhV2uw9kwMa/63lCrSnz3P3hIMDYUWPrSL8kV75+FfuBJAWJmXCr4seJck0SL0qTxEv ouX8a+JSopLoHPGQPxnycIXCZGNFM6as4Dx7z1Ksd7nNi6x0CkkIsbYpkTSM9E3yd1zzm6oN6xwJe X1Sdx2h9tVKrPMrRkt9EwGaKY2vfrzPC0yEEvBcccRTAokiJwih0rMFjd5lQVg/ttxtx2uD08yisU p0MrBGhA==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whTWK-000bLV-2i for pgsql-bugs@lists.postgresql.org; Wed, 08 Jul 2026 14:45:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whTWI-001SL4-2l for pgsql-bugs@lists.postgresql.org; Wed, 08 Jul 2026 14:45:04 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19548: Missing dependency between a graph edge and the related PK To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: christophe.courtois@dalibo.com Reply-To: christophe.courtois@dalibo.com, pgsql-bugs@lists.postgresql.org Date: Wed, 08 Jul 2026 14:44:47 +0000 Message-ID: <19548-6cac2e96468d7cb8@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19548 Logged by: Christophe Courtois Email address: christophe.courtois@dalibo.com PostgreSQL version: 19beta1 Operating system: Linux Debian 13 Description: =20 Hi, A dependency between a graph and the PK of a relationship seems to be missing. In the following example, a PK on the edge table is compulsory, but this PK can be cascade-dropped and the graph is unchanged. The graph can be dropped later, but it cannot be recreated : ERROR: no key specified and no suitable primary key exists for definition of element "family" I imagine that a pg_restore will fail too. Tested on 19~beta2-1~20260629.2015.g9cfd19bc10a.pgdg13+1 from apt.postgresql.org and 20devel freshly compiled. Full example : -- persons CREATE TABLE persons ( id TEXT PRIMARY KEY, nom TEXT, sexe TEXT ); CREATE TABLE family ( id TEXT PRIMARY KEY, spouse1 TEXT REFERENCES persons(id), spouse2 TEXT REFERENCES persons(id) ); CREATE PROPERTY GRAPH wedding VERTEX TABLES ( persons KEY (id) PROPERTIES ALL COLUMNS ) EDGE TABLES ( family SOURCE KEY (spouse1) REFERENCES persons (id) DESTINATION KEY (spouse2) REFERENCES persons (id) ); -- Drop the constraint -- CASCADE does NOT get rid if the graph ALTER TABLE family DROP CONSTRAINT family_pkey CASCADE ; -- The graph is still there \dG+ -- Recreation fails DROP PROPERTY GRAPH wedding ; CREATE PROPERTY GRAPH wedding VERTEX TABLES ( persons KEY (id) PROPERTIES ALL COLUMNS ) EDGE TABLES ( family SOURCE KEY (spouse1) REFERENCES persons (id) DESTINATION KEY (spouse2) REFERENCES persons (id) ); ERROR: no key specified and no suitable primary key exists for definition of element "family" LINE 6: family