如何在AgensGraph上删除属性约束?

时间:2019-05-31 05:01:06

标签: agens-graph

我想在AgensGraph上放置属性索引。

agens=# create vlabel v;
CREATE VLABEL
agens=# create elabel e;
CREATE ELABEL
agens=# create property index on v ( id );
CREATE PROPERTY INDEX
agens=# create property index on e ( id );
CREATE PROPERTY INDEX
agens=# drop property index on v ( id );
ERROR:  syntax error at or near "on"
LINE 1: drop property index on v ( id );
                            ^
agens=# drop property index on e ( id );
ERROR:  syntax error at or near "on"
LINE 1: drop property index on e ( id );
                            ^

但是,语法上存在一些问题。

如何在AgensGraph上放弃属性约束?

1 个答案:

答案 0 :(得分:0)

属性索引的名称在创建时自动创建。

您可以使用'\ dGe'和'\ dGe'来查找标签的结构。

agens=# \dGv v
        List of labels
 Graph | Name |  Type  | Owner 
-------+------+--------+-------
 graph | v    | vertex | agens
(1 row)

Vertex label "graph.v"
--
Property Indexes:
    "v_id_idx" btree (id)
Inherits: graph.ag_vertex

agens=# \dGe e
       List of labels
 Graph | Name | Type | Owner 
-------+------+------+-------
 graph | e    | edge | agens
(1 row)

Edge label "graph.e"
--
Property Indexes:
    "e_id_idx1" btree (id)
Inherits: graph.ag_edge

在搜索索引名称之后,接下来删除属性索引。

agens=# drop property index v_id_idx;
DROP PROPERTY INDEX
agens=# drop property index e_id_idx1;
DROP PROPERTY INDEX