Q:

DBeaver changes format of Redshift views

everytime I create a view in Amazon Redshift using the Tool "DBeaver" - it totaly meeses up my SQL-Code.
Is there any reason for this?
with CTE1 as (
            SELECT DISTINCT
                No_
            FROM 
                snapshots."_de_contract_header"
             ) Select * From CTE1

Right now I'm creating a View in Dbeaver using the create or Replace View Command
Create or Replace view snapshots.TEST as
with CTE1 as (
            SELECT DISTINCT
                No_
            FROM 
                snapshots."_de_contract_header"
             ) Select * From CTE1

When I try to view the source-code of this view , it looks like this:

With smaler statements like this it's no problem - functionality is the same. But if statements get bigger and more complex it's nearly impossible to read the source code. Any Ideas?

A:

That's not dbeaver, that's your database (Redshift).  It's rewritting the SQL into something it can run.  It always does this with queries, behind the scenes.
Store your view in a .sql file and reference that, not the printout from dbeaver.

