public inbox for [email protected]
help / color / mirror / Atom feedFrom: Khushboo Vashi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: Dependency tab fix
Date: Mon, 1 Feb 2021 17:46:29 +0530
Message-ID: <CAFOhELfHrWvTTLmGQoTs+dc3JtDDs4O=YDiDsz350-YY7+_jbQ@mail.gmail.com> (raw)
Hi,
Please find the attached patch to fix the dependency tab loading issue with
the database name having special characters like (',"" etc...)
Thanks,
Khushboo
Attachments:
[application/octet-stream] dependency_tab_fix.patch (2.2K, 3-dependency_tab_fix.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/templates/depends/gpdb/5_plus/role_dependencies.sql b/web/pgadmin/browser/server_groups/servers/templates/depends/gpdb/5_plus/role_dependencies.sql
index c3a3ba29c..bd225e39f 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/depends/gpdb/5_plus/role_dependencies.sql
+++ b/web/pgadmin/browser/server_groups/servers/templates/depends/gpdb/5_plus/role_dependencies.sql
@@ -3,6 +3,6 @@ FROM pg_shdepend dep
LEFT JOIN pg_roles r ON refclassid=1260 AND refobjid=r.oid
{{where_clause}}
{% if db_name %}
- AND dep.dbid = (SELECT oid FROM pg_database WHERE datname = '{{db_name}}')
+ AND dep.dbid = (SELECT oid FROM pg_database WHERE datname = {{ db_name|qtLiteral }})
{% endif %}
ORDER BY 1
diff --git a/web/pgadmin/browser/server_groups/servers/templates/depends/pg/9.1_plus/role_dependencies.sql b/web/pgadmin/browser/server_groups/servers/templates/depends/pg/9.1_plus/role_dependencies.sql
index c3a3ba29c..bd225e39f 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/depends/pg/9.1_plus/role_dependencies.sql
+++ b/web/pgadmin/browser/server_groups/servers/templates/depends/pg/9.1_plus/role_dependencies.sql
@@ -3,6 +3,6 @@ FROM pg_shdepend dep
LEFT JOIN pg_roles r ON refclassid=1260 AND refobjid=r.oid
{{where_clause}}
{% if db_name %}
- AND dep.dbid = (SELECT oid FROM pg_database WHERE datname = '{{db_name}}')
+ AND dep.dbid = (SELECT oid FROM pg_database WHERE datname = {{ db_name|qtLiteral }})
{% endif %}
ORDER BY 1
diff --git a/web/pgadmin/browser/server_groups/servers/templates/depends/ppas/9.1_plus/role_dependencies.sql b/web/pgadmin/browser/server_groups/servers/templates/depends/ppas/9.1_plus/role_dependencies.sql
index c3a3ba29c..bd225e39f 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/depends/ppas/9.1_plus/role_dependencies.sql
+++ b/web/pgadmin/browser/server_groups/servers/templates/depends/ppas/9.1_plus/role_dependencies.sql
@@ -3,6 +3,6 @@ FROM pg_shdepend dep
LEFT JOIN pg_roles r ON refclassid=1260 AND refobjid=r.oid
{{where_clause}}
{% if db_name %}
- AND dep.dbid = (SELECT oid FROM pg_database WHERE datname = '{{db_name}}')
+ AND dep.dbid = (SELECT oid FROM pg_database WHERE datname = {{ db_name|qtLiteral }})
{% endif %}
ORDER BY 1
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin4][Patch]: Dependency tab fix
In-Reply-To: <CAFOhELfHrWvTTLmGQoTs+dc3JtDDs4O=YDiDsz350-YY7+_jbQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox