{"Entry":{"collection":"sql","key":"drop-view","name":"DROP VIEW","aliases":["dropview"],"metadata":{"aliases":["dropview"],"changed_in":["6.5","7.1","7.3","8.2"],"changes":[{"from":"6.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["compatibility"],"removed":[]},"status":"changed","synopsis":{"added":["DROP VIEW name"],"removed":["DROP VIEW view"]},"to":"6.5"},{"from":"7.0","purpose_changed":true,"renamed":{"from_file":"sql-dropview.htm","to_file":"sql-dropview.html"},"sections":{"added":[],"changed":["description"],"removed":[]},"status":"changed","synopsis":{"added":["DROP VIEW name [, ...]"],"removed":[]},"to":"7.1"},{"from":"7.1","purpose_changed":true,"renamed":null,"sections":{"added":[],"changed":["compatibility"],"removed":[]},"status":"changed","synopsis":null,"to":"7.2"},{"from":"7.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["compatibility"],"removed":[]},"status":"changed","synopsis":{"added":["DROP VIEW name [, ...] [ CASCADE | RESTRICT ]"],"removed":[]},"to":"7.3"},{"from":"7.3","purpose_changed":false,"renamed":null,"sections":{"added":["parameters","examples","see_also"],"changed":["description","compatibility"],"removed":["usage"]},"status":"changed","synopsis":null,"to":"7.4"},{"from":"7.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["compatibility"],"removed":[]},"status":"changed","synopsis":null,"to":"8.0"},{"from":"8.1","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters","compatibility"],"removed":[]},"status":"changed","synopsis":{"added":["DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]"],"removed":[]},"to":"8.2"},{"from":"8.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["see_also"],"removed":[]},"status":"changed","synopsis":null,"to":"8.3"},{"from":"9.5","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"9.6"},{"from":"11","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"12"},{"from":"16","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"17"},{"from":"18","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"19"}],"content_hash":"c0fd031c6667415afceb24444cadf2d4d4836a67595ab07698ba295060120de0","derived_content_hash":"6de980d8107cf87762efb292f1d0d5d32e00cea046880dc9da8d7c172b3e9bfe","editorial":{},"first_version":"6.4","group":"table","imported_at":"2026-09-30T17:43:36.807488+08:00","last_version":"20","name":"DROP VIEW","object":"VIEW","position":14,"present_in":["6.4","6.5","7.0","7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"purpose":"remove a view","purpose_zh":"","related":["alter-view","create-view"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:fb45abdbb32b5a8073fd16a319e87118e6752de935b7733fdd2a1115a946c0ad","receipt_sha256":"68815234d38dddd6fe6fbb0a752989555c2c8734c43b254f3f81b66ca53fb77e","repair":"wiki-repair-20261023"},"slug":"drop-view","source_rev":"wiki-repair-20261023:3671e42214e4d74cf18b4bbbce6231f0b2b12a868df895629b9318506ab5a0d5","synopsis":"DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]","verb":"DROP"}},"Definition":{"Collection":"sql","Key":"drop-view","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"drop-view","SourceRevision":"wiki-repair-20261023:3671e42214e4d74cf18b4bbbce6231f0b2b12a868df895629b9318506ab5a0d5","Facts":{"anchor":"SQL-DROPVIEW","description_zh":"移除一个视图","description_zh_html":"\u003cpre\u003eDROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eDROP VIEW\u003c/code\u003e 删除一个现有视图。要执行此命令，你必须是该视图的拥有者。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      如果视图不存在，则不抛出错误，而是发出一条提示。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      要移除的视图名称（可选地使用模式限定）。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      自动删除依赖于该视图的对象（例如其他视图），以及进一步依赖于这些对象的所有对象（参见\u003ca class=\"xref\" href=\"/zh/docs/18/ddl-depend.html\" title=\"5.15. 依赖跟踪\"\u003e第 5.15 节\u003c/a\u003e）。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      如果有任何对象依赖于该视图，则拒绝删除它。这是默认行为。\n     \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e\n   这个命令将移除名为 \u003ccode class=\"literal\"\u003ekinds\u003c/code\u003e 的视图：\n\u003c/p\u003e\u003cpre class=\"programlisting\"\u003e\nDROP VIEW kinds;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e\n   此命令符合 SQL 标准，只是标准每条命令只允许删除一个视图，且 \u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e 选项是 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 扩展。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/zh/docs/18/sql-alterview.html\" title=\"ALTER VIEW\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER VIEW\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/zh/docs/18/sql-createview.html\" title=\"CREATE VIEW\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE VIEW\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","file":"sql-dropview.html","lang":"en","name":"DROP VIEW","purpose":"remove a view","purpose_zh":"移除一个视图","related":["alter-view","create-view"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP VIEW\u003c/code\u003e drops an existing view. To execute this command you must be the owner of the view.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the view does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the view to remove.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eAutomatically drop objects that depend on the view (such as other views), and in turn all objects that depend on those objects (see \u003ca href=\"/docs/18/ddl-depend.html\" title=\"5.15. Dependency Tracking\"\u003eSection 5.15\u003c/a\u003e).\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eRefuse to drop the view if any objects depend on it. This is the default.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eThis command will remove the view called \u003ccode class=\"literal\"\u003ekinds\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP VIEW kinds;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThis command conforms to the SQL standard, except that the standard only allows one view to be dropped per command, and apart from the \u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e option, which is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-view/?v=18\" title=\"ALTER VIEW\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER VIEW\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-view/?v=18\" title=\"CREATE VIEW\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE VIEW\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"DROP VIEW [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e [, ...] [ CASCADE | RESTRICT ]","synopsis_text":"DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/sql-dropview.html","sha256":"6719c08711d888eb01a72c236bedcc5f5e30a86634a9be313b9ca558e74be09f"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"drop-view","SourceDatabase":"center","Version":"18","Locale":"en","Title":"DROP VIEW","Summary":"remove a view","BodyHTML":"\u003cpre\u003eDROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eDROP VIEW\u003c/code\u003e drops an existing view. To execute this command you must be the owner of the view.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eParameters\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the view does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the view to remove.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eAutomatically drop objects that depend on the view (such as other views), and in turn all objects that depend on those objects (see \u003ca href=\"/docs/18/ddl-depend.html\" rel=\"nofollow\"\u003eSection 5.15\u003c/a\u003e).\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eRefuse to drop the view if any objects depend on it. This is the default.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eExamples\u003c/h2\u003e\u003cp\u003eThis command will remove the view called \u003ccode\u003ekinds\u003c/code\u003e:\u003c/p\u003e\u003cpre\u003eDROP VIEW kinds;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003eThis command conforms to the SQL standard, except that the standard only allows one view to be dropped per command, and apart from the \u003ccode\u003eIF EXISTS\u003c/code\u003e option, which is a \u003cspan\u003ePostgreSQL\u003c/span\u003e extension.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/alter-view/?v=18\" title=\"ALTER VIEW\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER VIEW\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-view/?v=18\" title=\"CREATE VIEW\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE VIEW\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"wiki-repair-20261023:3671e42214e4d74cf18b4bbbce6231f0b2b12a868df895629b9318506ab5a0d5","ContentHash":"4a784f648220a2bce317b847eb1a0b830d64f04c2f384620438f31769bac7f8f","Payload":{"related":["alter-view","create-view"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP VIEW\u003c/code\u003e drops an existing view. To execute this command you must be the owner of the view.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the view does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the view to remove.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eAutomatically drop objects that depend on the view (such as other views), and in turn all objects that depend on those objects (see \u003ca href=\"/docs/18/ddl-depend.html\" title=\"5.15. Dependency Tracking\"\u003eSection 5.15\u003c/a\u003e).\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eRefuse to drop the view if any objects depend on it. This is the default.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eThis command will remove the view called \u003ccode class=\"literal\"\u003ekinds\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP VIEW kinds;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThis command conforms to the SQL standard, except that the standard only allows one view to be dropped per command, and apart from the \u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e option, which is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-view/?v=18\" title=\"ALTER VIEW\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER VIEW\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-view/?v=18\" title=\"CREATE VIEW\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE VIEW\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","synopsis_html":"DROP VIEW [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e [, ...] [ CASCADE | RESTRICT ]","synopsis_text":"DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]"}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","6.4","6.5","7.0","7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
