[pgAdmin4][Patch#3021] Updating existing Index scan & Scan icons

2018-01-18 Thread Chethana Kumar
Hello Team,

I am sending a patch for the ex_index and ex_scan icons where those were
similar to each other  so I have made them easy to differentiate now.

It is respective to the issue *RM# 3021*

Thanks,

Chethana Kumar
Principal UI/UX Designer
EnterpriseDB Corporation


The Postgres Database Company

P: +91 86981 57146
www.enterprisedb.com
diff --git a/web/pgadmin/misc/static/explain/img/ex_index_scan.svg 
b/web/pgadmin/misc/static/explain/img/ex_index_scan.svg
index 84a20cd..2feb08a 100644
--- a/web/pgadmin/misc/static/explain/img/ex_index_scan.svg
+++ b/web/pgadmin/misc/static/explain/img/ex_index_scan.svg
@@ -1 +1 @@
-http://www.w3.org/2000/svg"; viewBox="0 0 64 
64">.cls-1,.cls-2,.cls-9{fill:#2980b9;}.cls-1,.cls-2{stroke:#2980b9;stroke-linejoin:round;}.cls-2{stroke-linecap:round;stroke-width:2px;}.cls-3,.cls-7{fill:#f0ecb6;}.cls-4{fill:#c18f36;}.cls-5{fill:#ffe65f;}.cls-6{opacity:0.8;}.cls-7{stroke:#c18f36;stroke-miterlimit:10;}.cls-8{fill:#addff3;}ex_index_scan
\ No newline at end of file
+http://www.w3.org/2000/svg"; viewBox="0 0 64 
64">.cls-1,.cls-2,.cls-9{fill:#2980b9;}.cls-1,.cls-2{stroke:#2980b9;stroke-linejoin:round;}.cls-2{stroke-linecap:round;stroke-width:2px;}.cls-3{fill:#e0d190;}.cls-4{fill:#c18f36;}.cls-5{fill:#ffe65f;}.cls-6{opacity:0.8;}.cls-7{fill:#f0ecb6;stroke:#c18f36;stroke-miterlimit:10;}.cls-8{fill:#addff3;}ex_index_scan
\ No newline at end of file
diff --git a/web/pgadmin/misc/static/explain/img/ex_scan.svg 
b/web/pgadmin/misc/static/explain/img/ex_scan.svg
index 7272eca..1df1e4f 100644
--- a/web/pgadmin/misc/static/explain/img/ex_scan.svg
+++ b/web/pgadmin/misc/static/explain/img/ex_scan.svg
@@ -1 +1 @@
-http://www.w3.org/2000/svg"; viewBox="0 0 64 
64">.cls-1,.cls-2,.cls-9{fill:#2980b9;}.cls-1,.cls-2{stroke:#2980b9;stroke-linejoin:round;}.cls-2{stroke-linecap:round;stroke-width:2px;}.cls-3,.cls-7{fill:#f0ecb6;}.cls-4{fill:#c18f36;}.cls-5{fill:#ffe65f;}.cls-6{opacity:0.8;}.cls-7{stroke:#c18f36;stroke-miterlimit:10;}.cls-8{fill:#addff3;}ex_scan
\ No newline at end of file
+http://www.w3.org/2000/svg"; viewBox="0 0 64 
64">.cls-1,.cls-2,.cls-8{fill:#2980b9;}.cls-1,.cls-2{stroke:#2980b9;stroke-linejoin:round;}.cls-2{stroke-linecap:round;stroke-width:2px;}.cls-3,.cls-6{fill:#f0ecb6;}.cls-4{fill:#c18f36;}.cls-5{opacity:0.8;}.cls-6{stroke:#c18f36;stroke-miterlimit:10;}.cls-7{fill:#addff3;}ex_scan
\ No newline at end of file


[pgadmin4]{Patch] Display GreenPlum partitions and correct SQL on SQL Tab

2018-01-18 Thread Joao De Almeida Pereira
Hello Hackers,

In the attached patches we enable the display of partitions on GreenPlum
database and also correct SQL that was being used in the SQL tab form
Schemas

Thanks
Joao
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
index e1e64be6..a4a53863 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
@@ -13,9 +13,24 @@ FROM
 ELSE 'UNKNOWN - ' || (d).privilege_type
 END AS privilege_type
 FROM
-(SELECT aclexplode(nsp.nspacl) as d
-FROM pg_namespace nsp
-WHERE nsp.oid = {{ scid|qtLiteral }}::OID
+(
+SELECT
+u_grantor.oid AS grantor,
+grantee.oid AS grantee,
+pr.type AS privilege_type,
+aclcontains(nc.nspacl, makeaclitem(grantee.oid, u_grantor.oid, 
pr.type, true)) AS is_grantable
+FROM pg_namespace nc, pg_authid u_grantor, (
+SELECT pg_authid.oid, pg_authid.rolname
+FROM pg_authid
+UNION ALL
+SELECT 0::oid AS oid, 'PUBLIC') grantee(oid, rolname),
+( SELECT 'CREATE'
+  UNION ALL
+  SELECT 'USAGE') pr(type)
+WHERE aclcontains(nc.nspacl, makeaclitem(grantee.oid, u_grantor.oid, 
pr.type, false))
+AND (pg_has_role(u_grantor.oid, 'USAGE'::text) OR 
pg_has_role(grantee.oid, 'USAGE'::text)
+OR grantee.rolname = 'PUBLIC'::name)
+AND nsp.oid = {{ scid|qtLiteral }}::OID
 ) a
 ) b
 LEFT JOIN pg_catalog.pg_roles g ON (b.grantor = g.oid)
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/defacl.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/defacl.sql
index 91c3085d..191e40cc 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/defacl.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/defacl.sql
@@ -1,40 +1,7 @@
 SELECT
-CASE (a.deftype)
-WHEN 'r' THEN 'deftblacl'
-WHEN 'S' THEN 'defseqacl'
-WHEN 'f' THEN 'deffuncacl'
-WHEN 'T' THEN 'deftypeacl'
-ELSE 'UNKNOWN - ' || a.deftype
-END AS deftype,
-COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, 
array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as 
grantable
-FROM
-(SELECT
-(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable 
AS is_grantable,
-CASE (acl).privilege_type
-WHEN 'CONNECT' THEN 'c'
-WHEN 'CREATE' THEN 'C'
-WHEN 'DELETE' THEN 'd'
-WHEN 'EXECUTE' THEN 'X'
-WHEN 'INSERT' THEN 'a'
-WHEN 'REFERENCES' THEN 'x'
-WHEN 'SELECT' THEN 'r'
-WHEN 'TEMPORARY' THEN 'T'
-WHEN 'TRIGGER' THEN 't'
-WHEN 'TRUNCATE' THEN 'D'
-WHEN 'UPDATE' THEN 'w'
-WHEN 'USAGE' THEN 'U'
-ELSE 'UNKNOWN - ' || (acl).privilege_type
-END AS privilege_type,
-defaclobjtype as deftype
-FROM
-(SELECT defaclobjtype, aclexplode(defaclacl) as acl
-FROM
-pg_namespace nsp
-LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON 
(dacl.defaclnamespace = nsp.oid)
-WHERE
-nsp.oid={{scid}}::oid
-) d) a
-LEFT JOIN pg_catalog.pg_roles g ON (a.grantor = g.oid)
-LEFT JOIN pg_catalog.pg_roles gt ON (a.grantee = gt.oid)
-GROUP BY g.rolname, gt.rolname, a.deftype
-ORDER BY a.deftype;
+'' AS deftype,
+'' AS grantee,
+'' AS grantor,
+'' AS grantor,
+'' AS privileges,
+'' AS grantable
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/properties.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/properties.sql
index ca2254d0..cce103ca 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/properties.sql
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/properties.sql
@@ -13,30 +13,13 @@ SELECT
 WHEN nspname LIKE E'pg\\_%' THEN true
 ELSE false END AS is_sys_object,
 {### Default ACL for Tables ###}
-(SELECT array_to_string(ARRAY(
-SELECT array_to_string(defaclacl::text[], ', ')
-FROM pg_default_acl
-WHERE defaclobjtype = 'r' AND defaclnamespace = nsp.oid
-), ', ')) AS tblacl,
+'' AS tblacl,
 {### Default ACL for Sequnces ###}
-(SELECT array_to_string(ARRAY(
-SELECT array_to_string

pgAdmin 4 commit: Branch refs/heads/runtime-revamp was created

2018-01-18 Thread git
Branch refs/heads/runtime-revamp was created.

View: 
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=shortlog;h=refs/heads/runtime-revamp