bitnine-oss / agensgraph

AgensGraph, a transactional graph database based on PostgreSQL
http://www.agensgraph.org
Other
1.33k stars 148 forks source link

foreign key constraint ERROR: cannot create trigger on graph label État SQL :XX000 #513

Open ThomasMic opened 4 years ago

ThomasMic commented 4 years ago

Hello,

I'm trying to set a FK constraint from a postgresql "classic" table TO AgensGraph "vertices" table (vertex LABEL is "oeuvre" in graph sudoc21graph)

Both colums in each table (id_oeuvre and id in vertex LABEL "oeuvre") are same type = graphid

When I ALTER my table (shema public a_pour_nomen_titre_o) trying to set the FK constraint i got message "ERROR: cannot create trigger on graph label " :

ALTER TABLE public.a_pour_nomen_titre_o ADD CONSTRAINT fk_id_oeuvre FOREIGN KEY (id_oeuvre) REFERENCES sudoc21graph.oeuvre (id) ON UPDATE NO ACTION ON DELETE NO ACTION;

Any help ?

Thanks, Thomas

these are the are the definition for table "a_pour_nomen_titre_o" in schema public :

CREATE TABLE public.a_pour_nomen_titre_o ( id_oeuvre graphid NOT NULL, id_nomen_titre text NOT NULL, CONSTRAINT pk_a_pour_nomen_titre_o PRIMARY KEY (id_nomen_titre, id_oeuvre) ) WITH ( OIDS=FALSE ); ALTER TABLE public.a_pour_nomen_titre_o OWNER TO agens;

and definition for "vertices" table "oeuvre" LABEL for vertex is standard AgensGraph created in schema "sudoc21graph" (the graph name) :

CREATE TABLE sudoc21graph.oeuvre ( id graphid NOT NULL DEFAULT graphid(graph_labid('sudoc21graph.oeuvre'::cstring), nextval('sudoc21graph.oeuvre_id_seq'::regclass)), properties jsonb NOT NULL DEFAULT jsonb_build_object(), CONSTRAINT oeuvre_pkey PRIMARY KEY (id) ) INHERITS (sudoc21graph.ag_vertex) WITH ( OIDS=FALSE ); ALTER TABLE sudoc21graph.oeuvre OWNER TO agens; COMMENT ON TABLE sudoc21graph.oeuvre IS 'base table for graph label sudoc21graph.oeuvre';