From 5b322d94e8a0efb0bd4123c392233473679d37a6 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 25 Jul 2019 16:16:44 +0100 Subject: [PATCH] Fix generation of reverse engineered SQL for tables with Greenplum 5.x. Fixes #4179 --- docs/en_US/release_notes_4_12.rst | 1 + .../tables/templates/tables/sql/gpdb_5.0_plus/properties.sql | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_4_12.rst b/docs/en_US/release_notes_4_12.rst index 0d523389f..a5a10d278 100644 --- a/docs/en_US/release_notes_4_12.rst +++ b/docs/en_US/release_notes_4_12.rst @@ -18,5 +18,6 @@ Housekeeping Bug fixes ********* +| `Issue #4179 `_ - Fix generation of reverse engineered SQL for tables with Greenplum 5.x. | `Issue #4490 `_ - Fix accessibility issue for checkbox in IE11. | `Issue #4508 `_ - Fix accessibility issue for Datetime cell in backgrid. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/gpdb_5.0_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/gpdb_5.0_plus/properties.sql index c690a1b84..ca7231acb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/gpdb_5.0_plus/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/gpdb_5.0_plus/properties.sql @@ -59,7 +59,7 @@ FROM ( substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_freeze_table_age=([0-9]*)') AS toast_autovacuum_freeze_table_age, array_to_string(rel.reloptions, ',') AS table_vacuum_settings_str, array_to_string(tst.reloptions, ',') AS toast_table_vacuum_settings_str, - rel.reloptions AS reloptions, tst.reloptions AS toast_reloptions, NULL AS reloftype, NULL AS typname, + rel.reloptions AS reloptions, tst.reloptions AS toast_reloptions, NULL AS reloftype, typ.typname AS typname, typ.typrelid AS typoid, (CASE WHEN rel.reltoastrelid = 0 THEN false ELSE true END) AS hastoasttable, -- Added for pgAdmin4 @@ -79,6 +79,7 @@ FROM ( LEFT OUTER JOIN pg_constraint con ON con.conrelid=rel.oid AND con.contype='p' LEFT OUTER JOIN pg_class tst ON tst.oid = rel.reltoastrelid LEFT OUTER JOIN gp_distribution_policy gdp ON gdp.localoid = rel.oid + LEFT OUTER JOIN pg_type typ ON typ.oid = rel.reltype WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }} {% if tid %} AND rel.oid = {{ tid }}::oid {% endif %}