[This topic is migrated from our old forums. The original author name has been removed]
DDL currently only shows the DDL for a view with 'create view' and not 'create or replace view'. A bit of a pain if I need to change a view query. Now I either need to change the sql by adding the 'or replace' bit or drop and recreate the view either way all added steps.
I have opened a ticker for looking into this when we go through the PostgreSQL support for the next feature version.
over 7 years ago
[This reply is migrated from our old forums.]
Re: Postgresql: DDL Create or Replace View
I've looked at this now and it turns out to be a bit trickier than I first thought, because it really should be consistent for all object types and all database types. Not every database we support supports CREATE OR REPLACE; some only support DROP/CREATE and others support CREATE/ALTER. It seems a bit odd to me to put DROP/CREATE or ALTER in the DDL tab just to simplify the case you describe.
There is already another way to get DROP/CREATE that I suggest that you try instead, namely the Export View action. In that dialog you can check off both Generate CREATE Statement and Generate DROP Statement and set the Output Destination to either SQL Editor or Clipboard:
Please let us know if this works for you.