Drops an existing Relation. It can only be executed by the Relation owner. A Relation cannot be dropped if there exists any queries that depend on that Relation. Note that deleting the Relation does not delete the Relation's underlying Entity.
DROP RELATION cannot be undone. Use it with care!
A Relation cannot be dropped if there exist any references to that Relation
Arguments
relation_name
The name of the Relation to drop. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.
Example
Drop a Relation using default Database and Schema
The following shows how to drop the Relation named pageviews:
demodb.public/demostore#LISTRELATIONS;+------------+------------+------------+------------+------------------------------------------+-------------------------------+-------------------------------+
| Name | Type | Owner | State | Properties | Created At | Updated At |
+============+============+============+============+==========================================+===============================+===============================+
| pageviews | stream | sysadmin | created | { "value.format": "json", "key.type": | 2024-07-03 15:25:20 +0000 UTC | 2024-07-03 15:25:21 +0000 UTC |
| | | | | "STRUCT\u003cuserid VARCHAR\u003e", | | |
| | | | | "topic": "pageviews", "store": | | |
| | | | | "demostore", "key.format": "json" } | | |
+------------+------------+------------+------------+------------------------------------------+-------------------------------+-------------------------------+
demodb.public/demostore#DROPRELATIONpageviews;+------------+-------------------------+------------+------------------------------------------+|Type|Name|Command|Summary|+============+=========================+============+==========================================+|query|demodb.public.pageviews|DROP|relationdemodb.public.pageviewswas|||||dropped|+------------+-------------------------+------------+------------------------------------------+demodb.public/demostore#LISTRELATIONS;+------------+------------+------------+------------+-------------+-------------+-------------+|Name|Type|Owner|State|Properties|CreatedAt|UpdatedAt|+============+============+============+============+=============+=============+=============++------------+------------+------------+------------+-------------+-------------+-------------+
Drop a Relation using fully qualified name
The following shows how to drop the Relation named PageViews in the Database OtherDB and Schema S1:
demodb.public/demostore#LISTRELATIONSINSCHEMA"OtherDB"."S1";+------------+------------+------------+------------+------------------------------------------+-------------------------------+-------------------------------+
| Name | Type | Owner | State | Properties | Created At | Updated At |
+============+============+============+============+==========================================+===============================+===============================+
| PageViews | stream | sysadmin | created | { "value.format": "json", "key.type": | 2024-07-03 15:28:22 +0000 UTC | 2024-07-03 15:28:24 +0000 UTC |
| | | | | "STRUCT\u003cuserid VARCHAR\u003e", | | |
| | | | | "topic": "pageviews", "store": | | |
| | | | | "demostore", "key.format": "json" } | | |
+------------+------------+------------+------------+------------------------------------------+-------------------------------+-------------------------------+
demodb.public/demostore#DROPRELATION"OtherDB"."S1"."PageViews";+------------+----------------------+------------+------------------------------------------+|Type|Name|Command|Summary|+============+======================+============+==========================================+|query|OtherDB.S1.PageViews|DROP|relationOtherDB.S1.PageViewswas|||||dropped|+------------+----------------------+------------+------------------------------------------+demodb.public/demostore#LISTRELATIONSINSCHEMA"OtherDB"."S1";+------------+------------+------------+------------+-------------+-------------+-------------+|Name|Type|Owner|State|Properties|CreatedAt|UpdatedAt|+============+============+============+============+=============+=============+=============++------------+------------+------------+------------+-------------+-------------+-------------+