Drops a named graph definition from the catalog and session registries without deleting the underlying vertex or edge Delta tables.
DROP GRAPH [IF EXISTS] <name>
## Overview DROP GRAPH removes a named graph definition that was previously created by CREATE GRAPH. The command unregisters the graph from both the session graph definition registry and the per-table graph configuration registry, and removes it from the catalog database. The underlying vertex and edge Delta tables are never modified or deleted. DROP GRAPH only removes the logical graph overlay that maps those tables into a property graph topology. To delete the tables themselves, use separate DROP TABLE statements. ## Execution Steps 1. The engine looks up the graph definition in the graph definition registry, first by simple name, then by fully qualified entity reference. 2. If found, the per-table graph configurations for the vertex table and edge table are unregistered from the session graph config registry. 3. The graph definition is unregistered from the graph definition registry. 4. The engine sends a delete request to the catalog router to remove the persisted definition (best-effort). If the catalog is unavailable, the command still succeeds for the current session. 5. If the graph is not found and IF EXISTS is not specified, the command returns an error. ## Effect on CSR Cache DROP GRAPH does not delete the .dcsr file on disk. The file becomes orphaned and is not loaded by subsequent queries because there is no graph definition to reference it. To reclaim disk space, manually delete the file from the `{edge_table_path}/_deltaforge/` directory, or re-create the graph and the engine will overwrite the file on the next CSR build. ## Effect on Running Queries If a Cypher query is currently executing against the graph at the time of DROP GRAPH, the running query is not interrupted. The CSR topology is held in memory by the active execution context. Only new queries that attempt to USE the dropped graph will fail. ## Access Control | Privilege | Object | Notes | |-----------|--------|-------| | Owner or ADMIN | Graph definition | The user must have created the graph or hold admin-level access. | ## Compatibility DROP GRAPH is a DeltaForge extension. It follows the convention established by SQL/PGQ for dropping named graph definitions. The IF EXISTS guard follows standard SQL DDL patterns.
| Name | Type | Description |
|---|---|---|
name | Specifies the name of the graph definition to drop. Accepts both simple names (e.g., social_network) and fully qualified names (e.g., zone.schema.social_network). The engine attempts resolution by simple name first, then by entity reference. | |
if_exists | Don't error if graph doesn't exist. |
-- Drop a graph definition
DROP GRAPH social_network;
-- Drop a graph only if it exists (no error if missing)
DROP GRAPH IF EXISTS social_network;
-- Drop a fully qualified graph definition
DROP GRAPH gold.social.social_network;
-- Typical cleanup workflow: drop graph, then optionally drop underlying tables
DROP GRAPH IF EXISTS org_chart;
DROP TABLE IF EXISTS gold.hr.employees;
DROP TABLE IF EXISTS gold.hr.reports_to;
-- Re-create a graph with different settings by dropping and recreating
DROP GRAPH IF EXISTS my_graph;
CREATE GRAPH my_graph
VERTEX TABLE gold.network.nodes ID COLUMN id
EDGE TABLE gold.network.edges SOURCE COLUMN src TARGET COLUMN dst
UNDIRECTED;