当前位置:网站首页>Gbase 8C - SQL reference 6 SQL syntax (10)
Gbase 8C - SQL reference 6 SQL syntax (10)
2022-07-27 05:57:00 【aisirea】
Function description
Remove an operator class .
Grammar format
DROP OPERATOR CLASS [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]
Parameter description
- IF EXISTS: If the operator class does not exist , No error, just prompt ;
- name: The name of an existing operator class , Can be modified by patterns ;
- index_method: The name of the index method used by this operator class ;
- CASCADE: Automatically delete objects that depend on this operator class ( For example index ), And all objects that depend on those objects ;
- RESTRICT: If any object depends on this operator class , Then refuse to delete , This is the default setting .
matters needing attention
Only the owner of the operator class can delete the operator class .
Example
remove B- Tree operator class widget_ops:
DROP OPERATOR CLASS widget_ops USING btree;
Grammar compatible
SQL There is no in the standard DROP OPERATOR CLASS sentence .
Related to the grammar
ALTER OPERATOR CLASS, CREATE OPERATOR CLASS, ALTER OPERATOR FAMILY, CREAT OPERATOR FAMILY, DROP OPERATOR FAMILY
Function description
Remove an operator family .
Grammar format
DROP OPERATOR FAMILY [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]
Parameter description
- IF EXISTS: If the operator family does not exist , No error, just prompt ;
- name: The name of the existing operator family , Can be modified by patterns ;
- index_method: The name of the index to which the operator family belongs ;
- CASCADE: Automatically delete objects that depend on this operator family , And all objects that depend on those objects ;
- RESTRICT: If any object depends on this operator family , Then refuse to delete , This is the default setting .
matters needing attention
Only the owner of the operator family can delete the operator family .
Example
remove B- Tree operator family float_ops:
DROP OPERATOR FAMILY float_ops USING btree;
Grammar compatible
SQL There is no in the standard DROP OPERATOR FAMILY sentence .
Related to the grammar
ALTER OPERATOR FAMILY, CREATE OPERATOR FAMILY, ALTER OPERATOR CLASS, CREATE OPERATOR CLASS, DROP OPERATOR CLASS
Function description
Delete the database object owned by a database role .
Grammar format
DROP OWNED BY { name | CURRENT_USER | SESSION_USER } [, ...] [ CASCADE | RESTRICT ]
Parameter description
- name: The name of the role to be deleted ;
- CASCADE: Automatically delete objects that depend on this role , And all objects that depend on those objects ;
- RESTRICT: If any object depends on the role , Then refuse to delete , This is the default setting .
matters needing attention
After removing roles , All the roles share objects in the current database ( database , Table space ) Permissions on all objects on will be revoked .
But the database 、 Tablespaces will not be removed .
Grammar compatible
DROP OWNED The order is a PostgreSQL Expand .
Related to the grammar
Function description
Remove a row level security policy .
Grammar format
DROP POLICY [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
Parameter description
- IF EXISTS: If the policy does not exist , No error, just prompt ;
- name: Name of the policy to be deleted ;
- table_name: The name of the table where the policy is located , Can be modified by patterns ;
- CASCADE | RESTRICT: No object depends on this row's access control policy , This statement is meaningless .
matters needing attention
Only the owner of the table can remove the row level security policy .
Example
DROP POLICY test_rls ON test_r;
DROP POLICY
Grammar compatible
DROP POLICY It's a kind of PostgreSQL Expand .
Related to the grammar
Function description
Delete the specified role .
Grammar format
DROP ROLE [ IF EXISTS ] name [, ...]
Parameter description
- IF EXISTS: If the role does not exist , No error, just prompt ;
- name: The name of the role to be removed .
matters needing attention
Only system administrators can remove the administrator role . To remove the non administrator role , Need to have CREATEROLE jurisdiction .
The role in the database occupation cannot be removed . Before deleting roles , You need to delete all objects owned by the role and their permissions .
Example
DROP ROLE gbasedbt;
DROP ROLE
Grammar compatible
SQL The standard defines DROP ROLE, But it only allows you to delete one role at a time and connect with PostgreSQL The authority of is different .
Related to the grammar
CREATE ROLE, ALTER ROLE, SET ROLE
Function description
Remove a rewrite rule .
Grammar format
DROP RULE [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
Parameter description
- IF EXISTS: If the rule does not exist , No error, just prompt ;
- name: Name of the rule to be removed ;
- table_name: The name of the table or view to which the rule applies , Can be modified by patterns ;
- CASCADE: Automatically delete objects that depend on this rule , And all objects that depend on those objects ;
- RESTRICT: If any object depends on this rule , Then refuse to delete , This is the default setting .
Example
DROP RULE newrule ON mytable;
DROP RULE
Grammar compatible
DROP RULE It's a PostgreSQL Language extension .
Related to the grammar
Function description
Remove a pattern .
Grammar format
DROP SCHEMA [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
Parameter description
- IF EXISTS: If the mode does not exist , No error, just prompt ;
- name: Name of the pattern ;
- CASCADE: Automatically delete objects that depend on this pattern ( surface 、 Functions, etc ), And all objects that depend on those objects ;
- RESTRICT: If any object depends on this schema , Then refuse to delete , This is the default setting .
matters needing attention
Only the owner of the schema has permission to execute DROP SCHEMA command .
Example
DROP SCHEMA gbaseschema CASCADE;
DROP SCHEMA
Grammar compatible
DROP SCHEMA accord with SQL standard ,IF EXISTS It's a PostgreSQL Expand .
Related to the grammar
Function description
Remove a sequence .
Grammar format
DROP SEQUENCE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
Parameter description
- IF EXISTS: If the sequence does not exist , No error, just prompt ;
- name: The name of the sequence , Can be modified by patterns ;
- CASCADE: Automatically delete objects that depend on this sequence , And all objects that depend on those objects ;
- RESTRICT: If any object depends on the sequence , Then refuse to delete , This is the default setting .
matters needing attention
Only the owner of the sequence can delete the sequence .
Example
DROP SEQUENCE serial;
DROP SEQUENCE
Grammar compatible
DROP SEQUENCE accord with SQL standard , Only IF EXISTS The option is a PostgreSQL Expand .
Related to the grammar
CREATE SEQUENCE, ALTER SEQUENCE
Function description
Delete extended statistics .
Grammar format
DROP STATISTICS [ IF EXISTS ] name [, ...]
Parameter description
- IF EXISTS: If the extended statistics does not exist , No error, just prompt ;
- name: Name of statistical object to be deleted , Can be modified by patterns ;
matters needing attention
Only the owner of the statistical object 、 The owner of the schema or the system administrator can delete the statistical object .
Example
DROP STATISTICS IF EXISTS
accounting.users_uid_creation,
public.grants_user_role;
Grammar compatible
SQL There is no in the standard DROP STATISTICS command .
Related to the grammar
ALTER STATISTICS, CREATE STATISTICS
Function description
Remove table .
Grammar format
DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
Parameter description
- IF EXISTS: If the table does not exist , No error, just prompt ;
- name: Name of the table to be deleted , Can be modified by patterns ;
- CASCADE: Automatically delete objects that depend on this table ( For example, view ), And all objects that depend on those objects ;
- RESTRICT: If any object depends on this table , Then refuse to delete , This is the default setting .
matters needing attention
DROP TABLE Will force the deletion of the specified table , After deleting the table , Indexes that depend on this table will be deleted , The functions and stored procedures that use this table cannot be executed . Delete partition table , All partitions in the partition table will be deleted at the same time .
Example
DROP TABLE t1;
DROP TABLE
Grammar compatible
This command conforms to SQL standard , However, the standard allows only one table to be deleted per command and IF EXISTS The option is a PostgreSQL Expand .
Related to the grammar
边栏推荐
猜你喜欢

11.感知机的梯度推导

NFT new paradigm, okaleido innovation NFT aggregation trading ecosystem

新冠时空分析——Global evidence of expressed sentiment alterations during the COVID-19 pandemic

Minio8.x version setting policy bucket policy

难道Redis真的变慢了吗?

Day14. 用可解释机器学习方法鉴别肠结核和克罗恩病

15.GPU加速、minist测试实战和visdom可视化

16.过拟合欠拟合

Aquanee will land in gate and bitmart in the near future, which is a good opportunity for low-level layout

Mysql5.7版本如何实现主从同步
随机推荐
7.合并与分割
Count the quantity in parallel after MySQL grouping
andorid检测GPU呈现速度和过度绘制
Day 8.Developing Simplified Chinese Psychological Linguistic Analysis Dictionary for Microblog
9.高阶操作
【高并发】面试官
Day 9. Graduate survey: A love–hurt relationship
什么是okr,和kpi的区别在哪里
15.GPU加速、minist测试实战和visdom可视化
Performance optimization of common ADB commands
How to realize master-slave synchronization in mysql5.7
Choose a qualified futures company to open an account
数字图像处理 第一章 绪论
go通过channel获取goroutine的处理结果
Do you really know session and cookies?
GBASE 8C——SQL参考4 字符集支持
GBASE 8C——SQL参考6 sql语法(12)
Day 8.Developing Simplified Chinese Psychological Linguistic Analysis Dictionary for Microblog
新冠时空分析——Global evidence of expressed sentiment alterations during the COVID-19 pandemic
Day 2. Depressive symptoms, post-traumatic stress symptoms and suicide risk among graduate students