Dmitriy Nemchin
Dmitriy Nemchin

Reputation: 19

datagrip introspections (Oracle and PostgreSQL)

I've trying to use 0xDBE as a replace for pgAdmin+PL/SQL Developer + Aginity Workbench for Greenplum, but there is one bad thing in introspection:

The IDE shows wrong DDL both for Oracle and PostgreSQL (and Greenplum also).


e.g. it shows this:

create VIEW LATENCIES (
    TASK_NAME VARCHAR2(250),
    DESTINATION_NAME VARCHAR2(200),
    APPLIED DATE
);

instead of this:

create or replace view latencies_new as
select table_schema, destination_name, min(applied) as applied from (
select table_schema, table_name, destination_name, max(unload_start) as applied
  from o2g_applies_full
 where apply_id is not null
   and unload_start > sysdate - 1
 group by table_schema, table_name, destination_name
) group by table_schema, destination_name;

in Oracle RDBMS. View and underlying tables are in the same schema, which is chosen for sync in DB options in DataGrip. Therefore Visualisation diagrams don't work at all.


The same situation with Postgres/GP - it can't show real DDL for external tables/views etc.

Is there any way to fix it? Maybe I should change drivers (now I use drivers downloaded from JetBrains site)?

Upvotes: 2

Views: 1505

Answers (2)

Vasilii Chernov
Vasilii Chernov

Reputation: 1464

One can try to use SQL ScriptsSQL Generator action to get DDL:

SQL Generator for View

SQL Generator for Foreign table

Upvotes: 1

Dmitriy Nemchin
Dmitriy Nemchin

Reputation: 19

Found an answer by myself...

If you try to directly copy DDL from Database window (on the left) - you can only copy first code mentioned in original post, but when you choose "View Editor" - "DDL" tab - then you will see full DDL.

Upvotes: 0

Related Questions