ALTER PROPERTY GRAPH — change the definition of an SQL-property graph
ALTER PROPERTY GRAPHnameADD [ {VERTEX|NODE} TABLES (vertex_table_definition[, ...] ) ] [ {EDGE|RELATIONSHIP} TABLES (edge_table_definition[, ...] ) ] ALTER PROPERTY GRAPHnameDROP {VERTEX|NODE} TABLES (vertex_table_alias[, ...] ) [ CASCADE | RESTRICT ] ALTER PROPERTY GRAPHnameDROP {EDGE|RELATIONSHIP} TABLES (edge_table_alias[, ...] ) [ CASCADE | RESTRICT ] ALTER PROPERTY GRAPHnameALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLEelement_table_alias{ ADD LABELlabel_name[ NO PROPERTIES | PROPERTIES ALL COLUMNS | PROPERTIES ( {expression[ ASproperty_name] } [, ...] ) ] } [ ... ] ALTER PROPERTY GRAPHnameALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLEelement_table_aliasDROP LABELlabel_name[ CASCADE | RESTRICT ] ALTER PROPERTY GRAPHnameALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLEelement_table_aliasALTER LABELlabel_nameADD PROPERTIES ( {expression[ ASproperty_name] } [, ...] ) ALTER PROPERTY GRAPHnameALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLEelement_table_aliasALTER LABELlabel_nameDROP PROPERTIES (property_name[, ...] ) [ CASCADE | RESTRICT ] ALTER PROPERTY GRAPHnameOWNER TO {new_owner| CURRENT_USER | SESSION_USER } ALTER PROPERTY GRAPHnameRENAME TOnew_nameALTER PROPERTY GRAPH [ IF EXISTS ]nameSET SCHEMAnew_schema
ALTER PROPERTY GRAPH changes the definition of an existing property graph. There are several subforms:
ADD {VERTEX|NODE|EDGE|RELATIONSHIP} TABLESThis form adds new vertex or edge tables to the property graph, using the same syntax as CREATE PROPERTY GRAPH.
DROP {VERTEX|NODE|EDGE|RELATIONSHIP} TABLESThis form removes vertex or edge tables from the property graph. (Only the association of the tables with the graph is removed. The tables themselves are not dropped.)
ALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLE ... ADD LABELThis form adds a new label to an existing vertex or edge table, using the same syntax as CREATE PROPERTY GRAPH.
ALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLE ... DROP LABELThis form removes a label from an existing vertex or edge table.
ALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLE ... ALTER LABEL ... ADD PROPERTIESThis form adds new properties to an existing label on an existing vertex or edge table.
ALTER {VERTEX|NODE|EDGE|RELATIONSHIP} TABLE ... ALTER LABEL ... DROP PROPERTIESThis form removes properties from an existing label on an existing vertex or edge table.
OWNERThis form changes the owner of the property graph to the specified user.
RENAMEThis form changes the name of a property graph.
SET SCHEMAThis form moves the property graph into another schema.
You must own the property graph to use ALTER PROPERTY GRAPH. To change a property graph's schema, you must also have CREATE privilege on the new schema. To alter the owner, you must be able to SET ROLE to the new owning role, and that role must have CREATE privilege on the property graph's schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the property graph. However, a superuser can alter ownership of any property graph anyway.)
nameThe name (optionally schema-qualified) of a property graph to be altered.
IF EXISTSDo not throw an error if the property graph does not exist. A notice is issued in this case.
vertex_table_definitionedge_table_definitionvertex_table_aliasedge_table_aliasThe alias of an existing vertex or edge table to operate on. (Note that the alias is potentially different from the name of the underlying table, if the vertex or edge table was created with AS .)alias
label_nameproperty_nameexpressionnew_ownerThe user name of the new owner of the property graph.
new_nameThe new name for the property graph.
new_schemaThe new schema for the property graph.
The consistency checks on a property graph described at the section called “Notes” must be maintained by ALTER PROPERTY GRAPH operations. In some cases, it might be necessary to make multiple alterations in a single command to satisfy the checks.
ALTER PROPERTY GRAPH g1 ADD VERTEX TABLES (v2); ALTER PROPERTY GRAPH g1 ALTER VERTEX TABLE v1 DROP LABEL foo; ALTER PROPERTY GRAPH g1 RENAME TO g2;
ALTER PROPERTY GRAPH conforms to ISO/IEC 9075-16 (SQL/PGQ).