2023-11-09 11:53:40 +08:00
|
|
|
-- Drop Table
|
|
|
|
DROP TABLE IF EXISTS table1, table2 RESTRICT;
|
|
|
|
DROP TABLE products CASCADE;
|
|
|
|
DROP TABLE products1;
|
|
|
|
|
2023-11-15 15:34:42 +08:00
|
|
|
-- DROP ACCESS METHOD
|
|
|
|
DROP ACCESS METHOD IF EXISTS name CASCADE;
|
|
|
|
DROP ACCESS METHOD name;
|
|
|
|
|
2023-11-09 11:53:40 +08:00
|
|
|
-- DROP AGGREGATE
|
2023-11-15 15:34:42 +08:00
|
|
|
DROP AGGREGATE IF EXISTS aggname1(int, integer), aggname2(IN argname integer) CASCADE;
|
2023-11-09 11:53:40 +08:00
|
|
|
DROP AGGREGATE aggname2(int);
|
|
|
|
|
|
|
|
-- DROP CAST
|
|
|
|
DROP CAST IF EXISTS (integer AS int) RESTRICT;
|
|
|
|
DROP CAST (int AS integer);
|
|
|
|
|
|
|
|
-- DROP COLLATION
|
|
|
|
DROP COLLATION IF EXISTS collation_name CASCADE;
|
|
|
|
DROP COLLATION collation_name1;
|
|
|
|
|
|
|
|
-- DROP CONVERSION
|
|
|
|
DROP CONVERSION IF EXISTS conver_name RESTRICT;
|
|
|
|
DROP CONVERSION conver_name1;
|
|
|
|
|
|
|
|
-- DROP DATABASE
|
2023-11-15 15:34:42 +08:00
|
|
|
DROP DATABASE IF EXISTS db_name WITH (FORCE);
|
2023-11-09 11:53:40 +08:00
|
|
|
DROP DATABASE db_name;
|
|
|
|
|
|
|
|
-- DROP DOMAIN
|
|
|
|
DROP DOMAIN IF EXISTS domain_name1, domain_name2 CASCADE;
|
|
|
|
DROP DOMAIN domain_name3;
|
|
|
|
|
|
|
|
-- DROP EVENT TRIGGER
|
|
|
|
DROP EVENT TRIGGER IF EXISTS trigger_name RESTRICT;
|
|
|
|
DROP EVENT TRIGGER trigger_name1;
|
|
|
|
|
|
|
|
-- DROP EXTENSION
|
|
|
|
DROP EXTENSION IF EXISTS extension_name1, extension_name2 CASCADE;
|
|
|
|
DROP EXTENSION extension_name3;
|
|
|
|
|
|
|
|
-- DROP FOREIGN DATA WRAPPER
|
|
|
|
DROP FOREIGN DATA WRAPPER IF EXISTS foreigndata_name RESTRICT;
|
|
|
|
DROP FOREIGN DATA WRAPPER foreigndata_name2;
|
|
|
|
|
|
|
|
-- DROP FOREIGN TABLE
|
|
|
|
DROP FOREIGN TABLE IF EXISTS foreigntable_name1, foreigntable_name2 CASCADE;
|
|
|
|
DROP FOREIGN TABLE foreigntable_name3;
|
|
|
|
|
|
|
|
-- DROP FUNCTION
|
|
|
|
DROP FUNCTION IF EXISTS function_name (IN argname integer) RESTRICT;
|
|
|
|
DROP FUNCTION function_name (integer);
|
|
|
|
|
|
|
|
-- DROP GROUP
|
|
|
|
DROP GROUP IF EXISTS group_name1, group_name2;
|
|
|
|
DROP GROUP group_name3;
|
|
|
|
|
|
|
|
-- DROP INDEX
|
|
|
|
DROP INDEX CONCURRENTLY IF EXISTS index_name1, index_name2 CASCADE;
|
|
|
|
DROP INDEX index_name3;
|
|
|
|
|
|
|
|
-- DROP LANGUAGE
|
|
|
|
DROP PROCEDURAL LANGUAGE IF EXISTS lan_name RESTRICT;
|
|
|
|
DROP LANGUAGE lan_name1;
|
|
|
|
|
|
|
|
-- DROP MATERIALIZED VIEW
|
|
|
|
DROP MATERIALIZED VIEW IF EXISTS view_name1, view_name2 CASCADE;
|
|
|
|
DROP MATERIALIZED VIEW view_name3;
|
|
|
|
|
|
|
|
-- DROP OPERATOR
|
|
|
|
DROP OPERATOR IF EXISTS ! ( NONE , int ) RESTRICT;
|
|
|
|
DROP OPERATOR - (int, int);
|
|
|
|
DROP OPERATOR ^ (int, int);
|
|
|
|
|
|
|
|
-- DROP OPERATOR CLASS
|
|
|
|
DROP OPERATOR CLASS IF EXISTS classs_name USING btree CASCADE;
|
|
|
|
DROP OPERATOR CLASS classs_name USING index_method;
|
|
|
|
|
|
|
|
-- DROP OPERATOR FAMILY
|
|
|
|
DROP OPERATOR FAMILY IF EXISTS family_name USING index_method RESTRICT;
|
|
|
|
DROP OPERATOR FAMILY family_name1 USING index_method;
|
|
|
|
|
|
|
|
-- DROP OWNED
|
2023-11-15 15:34:42 +08:00
|
|
|
DROP OWNED BY owner_name1, CURRENT_ROLE CASCADE;
|
|
|
|
DROP OWNED BY CURRENT_USER;
|
|
|
|
|
|
|
|
-- DROP POLICY
|
|
|
|
DROP POLICY IF EXISTS name ON table_name RESTRICT;
|
|
|
|
DROP POLICY name1 ON table_name1;
|
|
|
|
|
|
|
|
-- DROP PROCEDURE
|
|
|
|
DROP PROCEDURE IF EXISTS name( IN argname int, OUT argname integer), name1( OUT argname int, OUT argname int) CASCADE;
|
|
|
|
DROP PROCEDURE name1;
|
|
|
|
|
|
|
|
-- DROP PUBLICATION
|
|
|
|
DROP PUBLICATION IF EXISTS name CASCADE;
|
|
|
|
DROP PUBLICATION name;
|
2023-11-09 11:53:40 +08:00
|
|
|
|
|
|
|
-- DROP ROLE
|
|
|
|
DROP ROLE IF EXISTS role_name1, role_name2;
|
|
|
|
DROP ROLE role_name3;
|
|
|
|
|
2023-11-15 15:34:42 +08:00
|
|
|
-- DROP ROUTINE
|
|
|
|
DROP ROUTINE IF EXISTS name (IN argname int, OUT argname integer),name1( OUT argname int, OUT argname int) RESTRICT;
|
|
|
|
DROP ROUTINE name1;
|
|
|
|
|
2023-11-09 11:53:40 +08:00
|
|
|
-- DROP RULE
|
|
|
|
DROP RULE IF EXISTS rule_name ON table_name CASCADE;
|
|
|
|
DROP RULE rule_name1 ON table_name1;
|
|
|
|
|
|
|
|
-- DROP SCHEMA
|
|
|
|
DROP SCHEMA IF EXISTS schema_name1, schema_name2 RESTRICT;
|
|
|
|
DROP SCHEMA myschema;
|
|
|
|
|
|
|
|
-- DROP SEQUENCE
|
|
|
|
DROP SEQUENCE IF EXISTS con_name1, con_name2 CASCADE;
|
|
|
|
DROP SEQUENCE con_name3;
|
|
|
|
|
|
|
|
-- DROP SERVER
|
|
|
|
DROP SERVER IF EXISTS server_name RESTRICT;
|
|
|
|
DROP SERVER server_name1;
|
|
|
|
|
2023-11-15 15:34:42 +08:00
|
|
|
-- DROP STATISTICS
|
|
|
|
DROP STATISTICS IF EXISTS name, name1 CASCADE;
|
|
|
|
DROP STATISTICS name1;
|
|
|
|
|
|
|
|
-- DROP SUBSCRIPTION
|
|
|
|
DROP SUBSCRIPTION IF EXISTS name RESTRICT;
|
|
|
|
DROP SUBSCRIPTION name1;
|
|
|
|
|
2023-11-09 11:53:40 +08:00
|
|
|
-- DROP TABLESPACE
|
|
|
|
DROP TABLESPACE IF EXISTS tbspace_name1;
|
|
|
|
DROP TABLESPACE tbspace_name2;
|
|
|
|
|
|
|
|
-- DROP TEXT SEARCH CONFIGURATION
|
|
|
|
DROP TEXT SEARCH CONFIGURATION IF EXISTS text_name CASCADE;
|
|
|
|
DROP TEXT SEARCH CONFIGURATION text_name1;
|
|
|
|
|
|
|
|
-- DROP TEXT SEARCH DICTIONARY
|
|
|
|
DROP TEXT SEARCH DICTIONARY IF EXISTS dic_name1 RESTRICT;
|
|
|
|
DROP TEXT SEARCH DICTIONARY dic_name2;
|
|
|
|
|
|
|
|
-- DROP TEXT SEARCH PARSER
|
|
|
|
DROP TEXT SEARCH PARSER IF EXISTS parser_name1 CASCADE;
|
|
|
|
DROP TEXT SEARCH PARSER parser_name2;
|
|
|
|
|
|
|
|
-- DROP TEXT SEARCH TEMPLATE
|
|
|
|
DROP TEXT SEARCH TEMPLATE IF EXISTS temp_name1 RESTRICT;
|
|
|
|
DROP TEXT SEARCH TEMPLATE temp_name2;
|
|
|
|
|
2023-11-15 15:34:42 +08:00
|
|
|
-- DROP TRANSFORM
|
|
|
|
DROP TRANSFORM IF EXISTS FOR type_name LANGUAGE lang_name RESTRICT;
|
|
|
|
DROP TRANSFORM FOR type_name LANGUAGE lang_name;
|
|
|
|
|
2023-11-09 11:53:40 +08:00
|
|
|
-- DROP TRIGGER
|
|
|
|
DROP TRIGGER IF EXISTS trigger_name1 ON table_name1 CASCADE;
|
|
|
|
DROP TRIGGER trigger_name2 ON table_name2;
|
|
|
|
|
|
|
|
-- DROP TYPE
|
|
|
|
DROP TYPE IF EXISTS type_name1, type_name2 RESTRICT;
|
|
|
|
DROP TYPE type_name3;
|
|
|
|
|
|
|
|
-- DROP USER
|
|
|
|
DROP USER IF EXISTS user_name1, user_name2;
|
|
|
|
DROP USER user_name3;
|
|
|
|
|
|
|
|
-- DROP USER MAPPING
|
|
|
|
DROP USER MAPPING IF EXISTS FOR user_name SERVER server_name;
|
|
|
|
DROP USER MAPPING IF EXISTS FOR USER SERVER server_name;
|
|
|
|
DROP USER MAPPING IF EXISTS FOR CURRENT_USER SERVER server_name;
|
2023-11-15 15:34:42 +08:00
|
|
|
DROP USER MAPPING IF EXISTS FOR CURRENT_ROLE SERVER server_name;
|
2023-11-09 11:53:40 +08:00
|
|
|
DROP USER MAPPING IF EXISTS FOR PUBLIC SERVER server_name;
|
|
|
|
DROP USER MAPPING FOR PUBLIC SERVER server_name;
|
|
|
|
|
|
|
|
-- DROP VIEW
|
|
|
|
DROP VIEW IF EXISTS view_name1, view_name2 RESTRICT;
|
|
|
|
DROP VIEW view_name3;
|