我想通过删除数据库删除agensgraph上的所有图形。
有查询查找所有图形吗?
agens=# SELECT GRAPHNAME FROM ?????;
graphname
-----------
graph1
graph2
答案 0 :(得分:0)
使用AG_GRAPH表查找所有图形。
然后一张一张地放下图。
agens=# SELECT GRAPHNAME FROM AG_GRAPH;
graphname
-----------
graph1
graph2
graph
(3 rows)
agens=# DROP GRAPH GRAPH CASCADE;
NOTICE: drop cascades to 4 other objects
DETAIL: drop cascades to sequence graph.ag_label_seq
drop cascades to vlabel ag_vertex
drop cascades to elabel ag_edge
drop cascades to vlabel v
DROP GRAPH
agens=# DROP GRAPH GRAPH1 CASCADE;
NOTICE: drop cascades to 5 other objects
DETAIL: drop cascades to sequence graph1.ag_label_seq
drop cascades to vlabel ag_vertex
drop cascades to elabel ag_edge
drop cascades to vlabel v
drop cascades to elabel e
DROP GRAPH
agens=# DROP GRAPH GRAPH2 CASCADE;
NOTICE: drop cascades to 5 other objects
DETAIL: drop cascades to sequence graph2.ag_label_seq
drop cascades to vlabel ag_vertex
drop cascades to elabel ag_edge
drop cascades to vlabel v
drop cascades to elabel e
DROP GRAPH