DROP VIEW
Function
DROP VIEW forcibly deletes an existing view in a database.
Precautions
Only a view owner or a system administrator can run DROP VIEW command.
 
    - Be cautious when using DROP OBJECT (e.g., DATABASE, USER/ROLE, SCHEMA, TABLE, VIEW) as it may cause data loss, especially with CASCADE deletions. Always back up data before proceeding.
 - For more information about development and design proposal, see Development and Design Proposal.
 
Syntax
         1
          | 
        
         DROP VIEW [ IF EXISTS ] view_name [, ...] [ CASCADE | RESTRICT ];  | 
       
Parameter Description
| 
         Parameter  | 
       
         Description  | 
       
         Value Range  | 
      
|---|---|---|
| 
         IF EXISTS  | 
       
         Sends a notice instead of an error if the specified view does not exist.  | 
       
         -  | 
      
| 
         view_name  | 
       
         Specifies the name of the view to be deleted.  | 
       
         An existing view.  | 
      
| 
         CASCADE | RESTRICT  | 
       
         Specifies how to process related data in the dependent object when a delete operation is performed.  | 
       
        
  | 
      
Examples
Delete myView view.
         1
          | 
        
         DROP VIEW myView;  | 
       
Delete customer_details_view_v2 view.
         1
          | 
        
         DROP VIEW public.customer_details_view_v2;  | 
       
Helpful Links
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.