SQLPro icon indicating copy to clipboard operation
SQLPro copied to clipboard

Redshift create Drop/Create script for Materialized View creates wrong drop script

Open DM1145 opened this issue 1 year ago • 0 comments

If you right-click a Redshift Materialized View and create a drop/create script using the menu, the generated script contains a drop statement of "DROP VIEW .<viewName>;". To drop a Redshift materialized view, the drop query should read "DROP MATERIALIZED VIEW .<viewName>;".

To Reproduce Steps to reproduce the behavior:

  1. Select a materialized view in the left-hand object selector. Right Click.
  2. Select "Script As"
  3. Select "Drop and Create To"
  4. Select "New Query Window"
  5. Note the initial line of the generated script. It is "DROP VIEW .<viewName>;" which when executed against a materialized view throws an error. ERROR: "<viewName>" is not a view HINT: Use DROP MATERIALIZED VIEW to remove a materialized view. 0.003 seconds. (Line 1).

Expected behavior The drop query created in the script should read "DROP MATERIALIZED VIEW .<viewName>;" with the selected schema and materialized view incorporated in the script.

Environment details (please complete the following information):

  • Device: MacBook Pro M1
  • OS: OSX 14.5 (23F79)
  • SQLPro app Version: SQLPro Studio Version 2024.21 (Build 111093)
  • Installation source: Website download
  • Target database server: Amazon Redshift

Additional context Please reference AWS documentation:

DM1145 avatar Aug 14 '24 18:08 DM1145