RESTRICT 如果有任何对象依赖于该序列,则拒绝删除它。这是默认值。 示例 要移除序列serial: DROP SEQUENCE serial; 兼容性 DROP SEQUENCE符合 SQL标准,不过该标准只允许每个命令中删除一个序列并且没有IF EXISTS选项。该选项是一个 PostgreSQL扩展。 引用地址:PostgreSQL 13 SQL 命令 DROP SEQUENCE...
- For instance, "IF EXISTS" checks if the sequence to be dropped exists, then drops it if it does. While the CASCADE allows the users to delete the database objects that are dependent on a particular sequence. Execute the “DROP SEQUENCE” command with the comma-separated syntax to drop ...
RESTRICT 如果有任何对象依赖于该序列,则拒绝删除它。这是默认值。 示例 要移除序列serial: DROP SEQUENCE serial; 兼容性 DROP SEQUENCE符合SQL标准,不过该标准只允许每个命令中删除一个 序列并且没有IF EXISTS选项。该选项是一个 PostgreSQL扩展。 另见CREATE SEQUENCE, ALTER SEQUENCE ...
解释DROP TABLE IF EXISTS语句在PostgreSQL中的作用: DROP TABLE IF EXISTS语句用于在数据库中删除一个表,但前提是该表必须存在。如果表不存在,该语句不会执行任何操作,也不会引发错误。这避免了因尝试删除一个不存在的表而导致的运行时错误。 给出DROP TABLE IF EXISTS语句的基本语法格式: sql...
DROPvs.DROP IF EXISTSin PostgreSQL Versuchen wir, eine Tabelle zu löschen, die nicht in der Datenbank vorhanden ist. Beispiel: postgres=# drop table account;ERROR:table"account"doesnotexist postgres=#postgres=# drop table if exists account;NOTICE:table"account"doesnotexist,skippingDROPTABLEpostgres=...
DROP SEQUENCE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] 参数 IF EXISTS如果该序列不存在则不要抛出一个错误,而是发出一个提示。 name一个序列的名称(可以是模式限定的)。 CASCADE自动删除依赖于该序列的对象,然后删除所有依赖于那些对象的对象。 RESTRICT如果有任何对象依赖于该序列,则拒绝删除它...
RESTRICT 若有任何对象依赖服务器则拒绝删除它。这个是默认。 例子 若存在则删除服务器foo: DROP SERVER IF EXISTS foo;兼容性 DROP SERVER遵守ISO/IEC 9075-9 (SQL/MED)。 IF EXISTS子句是PostgreSQL扩展。 又见CREATE SERVER, ALTER SERVER 上一页 起始页 下一页 DROP SEQUENCE 上一级 DROP TABLE...
PostgreSQL supports the DROP command to externally delete the database from PostgreSQL. Use this command carefully as it drops the database permanently along with all the objects that belong to the database like tables, views, indexes, sequences, etc., which cannot be reverted. ...
DROP RULE [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ] 参数 IF EXISTS如果该规则不存在则不要抛出一个错误,而是发出一个提示。 name要删除的规则的名称。 table_name该规则适用的表或视图的名称(可以是模式限定的)。 CASCADE自动删除依赖于该规则的对象,然后删除所有依赖于那些对象的对象。 REST...
If you remove a column that does not exist, PostgreSQL will issue an error. To remove a column if it exists only, you can use the IF EXISTS option as follows: ALTER TABLE table_name DROP COLUMN IF EXISTS column_name; In this syntax, if you remove a column that does not exist, Postg...