Fix reverse engineered sql for Foreign Data Wrapper created on EPAS server in redwood mode. Fixes #4450

pull/25/head
Akshay Joshi 2019-07-09 12:21:13 +05:30
parent 08e6d54184
commit a17687e27c
3 changed files with 22 additions and 5 deletions

View File

@ -27,4 +27,5 @@ Bug fixes
| `Issue #4395 <https://redmine.postgresql.org/issues/4395>`_ - EXPLAIN options should be Query Tool instance-specific.
| `Issue #4429 <https://redmine.postgresql.org/issues/4429>`_ - Ensure drag/drop from the treeview works as expected on Firefox.
| `Issue #4437 <https://redmine.postgresql.org/issues/4437>`_ - Fix table icon issue when updating any existing field.
| `Issue #4442 <https://redmine.postgresql.org/issues/4442>`_ - Ensure browser should not be started by Selenium when feature tests are excluded from a test run.
| `Issue #4442 <https://redmine.postgresql.org/issues/4442>`_ - Ensure browser should not be started by Selenium when feature tests are excluded from a test run.
| `Issue #4450 <https://redmine.postgresql.org/issues/4450>`_ - Fix reverse engineered sql for Foreign Data Wrapper created on EPAS server in redwood mode.

View File

@ -1,8 +1,16 @@
{# ============= Get all the properties of foreign data wrapper ============= #}
SELECT fdw.oid as fdwoid, fdwname as name, fdwhandler, fdwvalidator, description,
array_to_string(fdwoptions, ',') AS fdwoptions, pg_get_userbyid(fdwowner) as fdwowner, array_to_string(fdwacl::text[], ', ') as acl,
quote_ident(vp_nsp.nspname)||'.'||quote_ident(vp.proname) AS fdwvalue,
quote_ident(vh_nsp.nspname)||'.'||quote_ident(vh.proname) AS fdwhan
CASE
-- EPAS in redwood mode, concatenation of a string with NULL results as the original string
WHEN vp.proname IS NULL THEN NULL
ELSE quote_ident(vp_nsp.nspname)||'.'||quote_ident(vp.proname)
END fdwvalue,
CASE
-- EPAS in redwood mode, concatenation of a string with NULL results as the original string
WHEN vh.proname IS NULL THEN NULL
ELSE quote_ident(vh_nsp.nspname)||'.'||quote_ident(vh.proname)
END fdwhan
FROM pg_foreign_data_wrapper fdw
LEFT OUTER JOIN pg_proc vh on vh.oid=fdwhandler
LEFT OUTER JOIN pg_proc vp on vp.oid=fdwvalidator

View File

@ -1,8 +1,16 @@
{# ============= Get all the properties of foreign data wrapper ============= #}
SELECT fdw.oid as fdwoid, fdwname as name, fdwhandler, fdwvalidator, description,
array_to_string(fdwoptions, ',') AS fdwoptions, pg_get_userbyid(fdwowner) as fdwowner, array_to_string(fdwacl::text[], ', ') as acl,
quote_ident(vp_nsp.nspname)||'.'||quote_ident(vp.proname) AS fdwvalue,
quote_ident(vh_nsp.nspname)||'.'||quote_ident(vh.proname) AS fdwhan
CASE
-- EPAS in redwood mode, concatenation of a string with NULL results as the original string
WHEN vp.proname IS NULL THEN NULL
ELSE quote_ident(vp_nsp.nspname)||'.'||quote_ident(vp.proname)
END fdwvalue,
CASE
-- EPAS in redwood mode, concatenation of a string with NULL results as the original string
WHEN vh.proname IS NULL THEN NULL
ELSE quote_ident(vh_nsp.nspname)||'.'||quote_ident(vh.proname)
END fdwhan
FROM pg_foreign_data_wrapper fdw
LEFT OUTER JOIN pg_proc vh on vh.oid=fdwhandler
LEFT OUTER JOIN pg_proc vp on vp.oid=fdwvalidator