Fix an issue of retrieving properties for Compound Triggers. It's a regression of #4006. Fixes #4952.

pull/27/head
Akshay Joshi 2019-12-02 15:01:54 +05:30
parent cccc6e5676
commit d95e8db4ee
2 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@ Bug fixes
| `Issue #4933 <https://redmine.postgresql.org/issues/4933>`_ - Ensure that the Servers collection node should expand independently of server connections.
| `Issue #4934 <https://redmine.postgresql.org/issues/4934>`_ - Fix the help button link on the User Management dialog.
| `Issue #4935 <https://redmine.postgresql.org/issues/4935>`_ - Fix accessibility issues.
| `Issue #4952 <https://redmine.postgresql.org/issues/4952>`_ - Fix an issue of retrieving properties for Compound Triggers. It's a regression of #4006.
| `Issue #4964 <https://redmine.postgresql.org/issues/4964>`_ - Fix an issue where length and precision are not removed from table/column dialog.
| `Issue #4965 <https://redmine.postgresql.org/issues/4965>`_ - Fix an issue where the Interval data type is not displayed in the properties dialog of table/column.
| `Issue #4978 <https://redmine.postgresql.org/issues/4978>`_ - Fix pgAdmin4 failed to start issue after upgrading to version 4.15.

View File

@ -4,10 +4,10 @@ SELECT t.oid,t.tgname AS name, t.xmin, t.tgenabled AS is_enable_trigger, t.tgtyp
regexp_replace(regexp_replace(pg_get_triggerdef(t.oid),
'CREATE TRIGGER (.*) FOR (.*) ON (.*) \nCOMPOUND TRIGGER (.*)\n', ''), '[\n]?END$', ''
) AS prosrc,
COALESCE(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) \nCOMPOUND'), NULL) AS whenclause,
{% if datlastsysoid %}
(CASE WHEN t.oid <= {{ datlastsysoid}}::oid THEN true ElSE false END) AS is_sys_trigger
(CASE WHEN t.oid <= {{ datlastsysoid}}::oid THEN true ElSE false END) AS is_sys_trigger,
{% endif %}
COALESCE(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) \nCOMPOUND'), NULL) AS whenclause
FROM pg_trigger t
JOIN pg_class cl ON cl.oid=tgrelid
JOIN pg_namespace na ON na.oid=relnamespace