Fixed an issue where foreign data wrapper properties are not visible if the host option contains two host addresses. Fixes #6379

This commit is contained in:
Yogesh Mahajan 2021-04-19 11:08:21 +05:30 committed by Akshay Joshi
parent 8596f15ae7
commit dc65cbb08c
8 changed files with 9 additions and 7 deletions

View File

@ -39,4 +39,5 @@ Bug fixes
| `Issue #6367 <https://redmine.postgresql.org/issues/6367>`_ - Fixed an issue where the Save button is enabled by default when open the table's properties dialog on PG 9.5.
| `Issue #6375 <https://redmine.postgresql.org/issues/6375>`_ - Fixed an issue where users are unable to see data of the partitions using the View/Edit data option.
| `Issue #6376 <https://redmine.postgresql.org/issues/6376>`_ - Fixed an issue where a connection warning should be displayed on the user clicks on explain or explain analyze and the database server is disconnected from the browser tree.
| `Issue #6379 <https://redmine.postgresql.org/issues/6379>`_ - Fixed an issue where foreign data wrapper properties are not visible if the host option contains two host addresses.
| `Issue #6385 <https://redmine.postgresql.org/issues/6385>`_ - Ensure that Backup and Restore should work on shared servers.

View File

@ -6,7 +6,7 @@ LEFT OUTER JOIN pg_catalog.pg_description des ON (des.objoid=fdw.oid AND des.obj
WHERE fdw.oid={{fdwid}}::oid
{% else %}
SELECT srv.oid, srvname as name, srvfdw as fdwid, srvtype as fsrvtype, srvversion as fsrvversion,
fdw.fdwname as fdwname, description, pg_catalog.array_to_string(srvoptions, ',') AS fsrvoptions,
fdw.fdwname as fdwname, description, srvoptions AS fsrvoptions,
pg_catalog.pg_get_userbyid(srvowner) as fsrvowner, pg_catalog.array_to_string(srvacl::text[], ', ') as acl
FROM pg_catalog.pg_foreign_server srv
LEFT OUTER JOIN pg_catalog.pg_foreign_data_wrapper fdw on fdw.oid=srvfdw

View File

@ -7,7 +7,7 @@ LEFT OUTER JOIN pg_catalog.pg_description des ON (des.objoid=fdw.oid AND des.obj
WHERE fdw.oid={{fdwid}}::oid
{% else %}
SELECT srv.oid, srvname as name, srvtype as fsrvtype, srvversion as fsrvversion, fdw.fdwname as fdwname, description,
pg_catalog.array_to_string(srvoptions, ',') AS fsrvoptions,
srvoptions AS fsrvoptions,
pg_catalog.pg_get_userbyid(srvowner) as fsrvowner, pg_catalog.array_to_string(srvacl::text[], ', ') as acl
FROM pg_catalog.pg_foreign_server srv
LEFT OUTER JOIN pg_catalog.pg_foreign_data_wrapper fdw on fdw.oid=srvfdw

View File

@ -5,7 +5,7 @@ FROM pg_catalog.pg_foreign_server srv
LEFT OUTER JOIN pg_catalog.pg_description des ON (des.objoid=srv.oid AND des.objsubid=0 AND des.classoid='pg_foreign_server'::regclass)
WHERE srv.oid = {{fserid}}::oid
{% elif fsid or umid %}
SELECT u.umid AS oid, u.usename AS name, u.srvid AS fsid, pg_catalog.array_to_string(u.umoptions, ',') AS umoptions, fs.srvfdw AS fdwid
SELECT u.umid AS oid, u.usename AS name, u.srvid AS fsid, umoptions AS umoptions, fs.srvfdw AS fdwid
FROM pg_catalog.pg_user_mappings u
LEFT JOIN pg_catalog.pg_foreign_server fs ON fs.oid = u.srvid
{% if fsid %} WHERE u.srvid = {{fsid}}::oid {% endif %} {% if umid %} WHERE u.umid= {{umid}}::oid {% endif %}

View File

@ -1,6 +1,6 @@
{# ============= Get all the properties of foreign data wrapper ============= #}
SELECT fdw.oid, fdwname as name, fdwhandler, fdwvalidator, description,
pg_catalog.array_to_string(fdwoptions, ',') AS fdwoptions, pg_catalog.pg_get_userbyid(fdwowner) as fdwowner, pg_catalog.array_to_string(fdwacl::text[], ', ') as acl,
fdwoptions AS fdwoptions, pg_catalog.pg_get_userbyid(fdwowner) as fdwowner, pg_catalog.array_to_string(fdwacl::text[], ', ') as acl,
CASE
-- EPAS in redwood mode, concatenation of a string with NULL results as the original string
WHEN vp.proname IS NULL THEN NULL

View File

@ -1,6 +1,6 @@
{# ============= Get all the properties of foreign data wrapper ============= #}
SELECT fdw.oid, fdwname as name, fdwhandler, fdwvalidator, description,
pg_catalog.array_to_string(fdwoptions, ',') AS fdwoptions, pg_catalog.pg_get_userbyid(fdwowner) as fdwowner, pg_catalog.array_to_string(fdwacl::text[], ', ') as acl,
fdwoptions AS fdwoptions, pg_catalog.pg_get_userbyid(fdwowner) as fdwowner, pg_catalog.array_to_string(fdwacl::text[], ', ') as acl,
CASE
-- EPAS in redwood mode, concatenation of a string with NULL results as the original string
WHEN vp.proname IS NULL THEN NULL

View File

@ -161,8 +161,7 @@ def tokenize_options(options_from_db, option_name, option_value):
"""
options = []
if options_from_db is not None:
option_str = options_from_db.split(',')
for fdw_option in option_str:
for fdw_option in options_from_db:
k, v = fdw_option.split('=', 1)
options.append({option_name: k, option_value: v})
return options

View File

@ -52,6 +52,8 @@
#editor-panel {
z-index: 0;
position: absolute;
top: $sql-editor-panel-top;
bottom: 0;
left: 0;
right: 0;