| From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Cc: | christophe(dot)courtois(at)dalibo(dot)com |
| Subject: | BUG #19548: Missing dependency between a graph edge and the related PK |
| Date: | 2026-07-08 14:44:47 |
| Message-ID: | 19548-6cac2e96468d7cb8@postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 19548
Logged by: Christophe Courtois
Email address: christophe(dot)courtois(at)dalibo(dot)com
PostgreSQL version: 19beta1
Operating system: Linux Debian 13
Description:
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Imran Zaheer | 2026-07-08 15:00:28 | Re: BUG #19519: REPACK can fail due to missing chunk for toast value |
| Previous Message | Heikki Linnakangas | 2026-07-08 14:36:04 | Re: BUG #19545: Integer truncation of `GinTuple.keylen` causes out-of-bounds read in parallel GIN index build |