Use PUBLIC (in caps) whenever used as a keyword. Fixes #1138

This commit is contained in:
Ashesh Vashi 2016-06-23 09:15:04 +05:30
parent 0ee096dbf6
commit b78b3904cd
66 changed files with 83 additions and 86 deletions

View File

@ -1,4 +1,4 @@
SELECT 'fsrvacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'fsrvacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,

View File

@ -2,11 +2,11 @@
{% if fsid %} {% if fsid %}
WITH umapData AS WITH umapData AS
( (
SELECT u.oid AS um_oid, CASE WHEN u.umuser = 0::oid THEN 'public'::name ELSE a.rolname END AS name, SELECT u.oid AS um_oid, CASE WHEN u.umuser = 0::oid THEN 'PUBLIC'::name ELSE a.rolname END AS name,
array_to_string(u.umoptions, ',') AS umoptions FROM pg_user_mapping u array_to_string(u.umoptions, ',') AS umoptions FROM pg_user_mapping u
LEFT JOIN pg_authid a ON a.oid = u.umuser WHERE u.umserver = {{ fsid }}::OID LEFT JOIN pg_authid a ON a.oid = u.umuser WHERE u.umserver = {{ fsid }}::OID
) )
SELECT um.um_oid, name, dep.deptype FROM umapData um SELECT um.um_oid, name, dep.deptype FROM umapData um
LEFT JOIN pg_depend dep ON dep.objid=um.um_oid LEFT JOIN pg_depend dep ON dep.objid=um.um_oid
{% endif %} {% endif %}

View File

@ -1,4 +1,4 @@
SELECT 'fsrvacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'fsrvacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,

View File

@ -2,11 +2,11 @@
{% if fsid %} {% if fsid %}
WITH umapData AS WITH umapData AS
( (
SELECT u.oid AS um_oid, CASE WHEN u.umuser = 0::oid THEN 'public'::name ELSE a.rolname END AS name, SELECT u.oid AS um_oid, CASE WHEN u.umuser = 0::oid THEN 'PUBLIC'::name ELSE a.rolname END AS name,
array_to_string(u.umoptions, ',') AS umoptions FROM pg_user_mapping u array_to_string(u.umoptions, ',') AS umoptions FROM pg_user_mapping u
LEFT JOIN pg_authid a ON a.oid = u.umuser WHERE u.umserver = {{ fsid }}::OID LEFT JOIN pg_authid a ON a.oid = u.umuser WHERE u.umserver = {{ fsid }}::OID
) )
SELECT um.um_oid, name, dep.deptype FROM umapData um SELECT um.um_oid, name, dep.deptype FROM umapData um
LEFT JOIN pg_depend dep ON dep.objid=um.um_oid LEFT JOIN pg_depend dep ON dep.objid=um.um_oid
{% endif %} {% endif %}

View File

@ -336,9 +336,6 @@ class UserMappingView(PGChildNodeView):
if not status: if not status:
return internal_server_error(errormsg=res) return internal_server_error(errormsg=res)
if res['rows'][0]['name'] == 'public':
res['rows'][0]['name'] = 'PUBLIC'
if res['rows'][0]['umoptions'] is not None: if res['rows'][0]['umoptions'] is not None:
res['rows'][0]['umoptions'] = self.tokenizeOptions(res['rows'][0]['umoptions']) res['rows'][0]['umoptions'] = self.tokenizeOptions(res['rows'][0]['umoptions'])

View File

@ -8,7 +8,7 @@ WHERE srv.oid = {{fserid}}::int
{% if fsid or umid or fdwdata or data %} {% if fsid or umid or fdwdata or data %}
WITH umapData AS WITH umapData AS
( (
SELECT u.oid AS um_oid, CASE WHEN u.umuser = 0::oid THEN 'public'::name ELSE a.rolname END AS name, SELECT u.oid AS um_oid, CASE WHEN u.umuser = 0::oid THEN 'PUBLIC'::name ELSE a.rolname END AS name,
array_to_string(u.umoptions, ',') AS umoptions FROM pg_user_mapping u array_to_string(u.umoptions, ',') AS umoptions FROM pg_user_mapping u
LEFT JOIN pg_authid a ON a.oid = u.umuser {% if fsid %} WHERE u.umserver = {{fsid}}::int {% endif %} {% if umid %} WHERE u.oid= {{umid}}::int {% endif %} LEFT JOIN pg_authid a ON a.oid = u.umuser {% if fsid %} WHERE u.umserver = {{fsid}}::int {% endif %} {% if umid %} WHERE u.oid= {{umid}}::int {% endif %}
) )
@ -20,4 +20,4 @@ WITH umapData AS
WHERE fdw.fdwname = {{fdwdata.name|qtLiteral}}::text WHERE fdw.fdwname = {{fdwdata.name|qtLiteral}}::text
{% endif %} {% endif %}
ORDER BY 2; ORDER BY 2;
{% endif %} {% endif %}

View File

@ -1,4 +1,4 @@
SELECT 'fdwacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'fdwacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,

View File

@ -1,4 +1,4 @@
SELECT 'fdwacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'fdwacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,
@ -18,4 +18,4 @@ FROM
) d ) d
LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid) LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid) LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
GROUP BY g.rolname, gt.rolname GROUP BY g.rolname, gt.rolname

View File

@ -314,7 +314,7 @@ class LanguageView(PGChildNodeView):
# if no acl found then by default add public # if no acl found then by default add public
if res['rows'][0]['acl'] is None: if res['rows'][0]['acl'] is None:
res['rows'][0]['lanacl'] = dict() res['rows'][0]['lanacl'] = dict()
res['rows'][0]['lanacl']['grantee'] = 'public' res['rows'][0]['lanacl']['grantee'] = 'PUBLIC'
res['rows'][0]['lanacl']['grantor'] = res['rows'][0]['lanowner'] res['rows'][0]['lanacl']['grantor'] = res['rows'][0]['lanowner']
res['rows'][0]['lanacl']['privileges'] = [{'privilege_type': 'U', 'privilege': True, 'with_grant': False}] res['rows'][0]['lanacl']['privileges'] = [{'privilege_type': 'U', 'privilege': True, 'with_grant': False}]
else: else:

View File

@ -1,4 +1,4 @@
SELECT 'lanacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, SELECT 'lanacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT

View File

@ -1,4 +1,4 @@
SELECT 'lanacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, SELECT 'lanacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,5 +1,5 @@
SELECT SELECT
COALESCE(gt.rolname, 'public') AS grantee, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -1,4 +1,4 @@
SELECT 'relacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'relacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,
@ -27,4 +27,4 @@ FROM
) d ) d
LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid) LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid) LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
GROUP BY g.rolname, gt.rolname GROUP BY g.rolname, gt.rolname

View File

@ -1,4 +1,4 @@
SELECT 'attacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'attacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,
@ -31,4 +31,4 @@ FROM
) d ) d
LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid) LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid) LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
GROUP BY g.rolname, gt.rolname GROUP BY g.rolname, gt.rolname

View File

@ -1,4 +1,4 @@
SELECT 'attacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'attacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,
@ -31,4 +31,4 @@ FROM
) d ) d
LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid) LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid) LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
GROUP BY g.rolname, gt.rolname GROUP BY g.rolname, gt.rolname

View File

@ -1,5 +1,5 @@
{### SQL to fetch privileges for tablespace ###} {### SQL to fetch privileges for tablespace ###}
SELECT 'relacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, SELECT 'relacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
@ -43,4 +43,4 @@ FROM
) d ) d
LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid) LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid) LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
GROUP BY g.rolname, gt.rolname GROUP BY g.rolname, gt.rolname

View File

@ -1,5 +1,5 @@
{### SQL to fetch privileges for tablespace ###} {### SQL to fetch privileges for tablespace ###}
SELECT 'relacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, SELECT 'relacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
@ -43,4 +43,4 @@ FROM
) d ) d
LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid) LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid) LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
GROUP BY g.rolname, gt.rolname GROUP BY g.rolname, gt.rolname

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl' WHEN 'f' THEN 'deffuncacl'
ELSE 'UNKNOWN - ' || a.deftype ELSE 'UNKNOWN - ' || a.deftype
END AS 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 COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
FROM FROM
(SELECT (SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable, (acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -6,7 +6,7 @@ SELECT
WHEN 'T' THEN 'deftypeacl' WHEN 'T' THEN 'deftypeacl'
ELSE 'UNKNOWN - ' || a.deftype ELSE 'UNKNOWN - ' || a.deftype
END AS 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 COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
FROM FROM
(SELECT (SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable, (acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl' WHEN 'f' THEN 'deffuncacl'
ELSE 'UNKNOWN - ' || a.deftype ELSE 'UNKNOWN - ' || a.deftype
END AS 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 COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
FROM FROM
(SELECT (SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable, (acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #} {# Fetch privileges for schema #}
SELECT SELECT
'nspacl' as deftype, COALESCE(gt.rolname, 'public') AS grantee, 'nspacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(b.privilege_type) AS privileges, g.rolname AS grantor, array_agg(b.privilege_type) AS privileges,
array_agg(b.is_grantable) AS grantable array_agg(b.is_grantable) AS grantable
FROM FROM

View File

@ -6,7 +6,7 @@ SELECT
WHEN 'T' THEN 'deftypeacl' WHEN 'T' THEN 'deftypeacl'
ELSE 'UNKNOWN - ' || a.deftype ELSE 'UNKNOWN - ' || a.deftype
END AS 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 COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
FROM FROM
(SELECT (SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable, (acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,4 +1,4 @@
SELECT 'typacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable SELECT 'typacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT
d.grantee, d.grantor, d.is_grantable, d.grantee, d.grantor, d.is_grantable,
@ -23,4 +23,4 @@ FROM
) d ) d
LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid) LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid) LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
GROUP BY g.rolname, gt.rolname GROUP BY g.rolname, gt.rolname

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -2,7 +2,7 @@
{% if vid %} {% if vid %}
SELECT SELECT
'datacl' as deftype, 'datacl' as deftype,
COALESCE(gt.rolname, 'public') grantee, COALESCE(gt.rolname, 'PUBLIC') grantee,
g.rolname grantor, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(privilege_type) as privileges,
array_agg(is_grantable) as grantable array_agg(is_grantable) as grantable

View File

@ -1,5 +1,5 @@
SELECT SELECT
'datacl' AS deftype, COALESCE(gt.rolname, 'public') AS grantee, 'datacl' AS deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl' WHEN 'f' THEN 'deffuncacl'
WHEN 'T' THEN 'deftypeacl' WHEN 'T' THEN 'deftypeacl'
END AS 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 COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
FROM FROM
(SELECT (SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable, (acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,5 +1,5 @@
SELECT SELECT
'datacl' AS deftype, COALESCE(gt.rolname, 'public') AS grantee, 'datacl' AS deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname grantor, array_agg(privilege_type) AS privileges, g.rolname grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl' WHEN 'f' THEN 'deffuncacl'
WHEN 'T' THEN 'deftypeacl' WHEN 'T' THEN 'deftypeacl'
END AS 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 COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
FROM FROM
(SELECT (SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable, (acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,5 +1,5 @@
SELECT SELECT
'datacl' AS deftype, COALESCE(gt.rolname, 'public') AS grantee, 'datacl' AS deftype, COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges, g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable array_agg(is_grantable) AS grantable
FROM FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl' WHEN 'f' THEN 'deffuncacl'
WHEN 'T' THEN 'deftypeacl' WHEN 'T' THEN 'deftypeacl'
END AS deftype, END AS deftype,
COALESCE(gt.rolname, 'public') AS grantee, g.rolname AS grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable COALESCE(gt.rolname, 'PUBLIC') AS grantee, g.rolname AS grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
FROM FROM
(SELECT (SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable, (acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -88,7 +88,7 @@
Backgrid.Extension.NodeListByNameCell.prototype.defaults.transform.apply( Backgrid.Extension.NodeListByNameCell.prototype.defaults.transform.apply(
this, arguments this, arguments
); );
res.unshift({label: 'public', value: 'public'}); res.unshift({label: 'PUBLIC', value: 'PUBLIC'});
return res; return res;
}, },
cell: Backgrid.Extension.NodeListByNameCell.extend({ cell: Backgrid.Extension.NodeListByNameCell.extend({
@ -239,7 +239,7 @@
grantee = this.get('grantee'); grantee = this.get('grantee');
// Reset all with grant options if grantee is public. // Reset all with grant options if grantee is public.
if (grantee == 'public') { if (grantee == 'PUBLIC') {
privileges.each(function(m) { privileges.each(function(m) {
m.set("with_grant", false, {silent: true}); m.set("with_grant", false, {silent: true});
}); });
@ -379,8 +379,8 @@
'target': self.cid, 'target': self.cid,
'header': false, 'header': false,
'privilege_label': self.Labels[d.privilege_type], 'privilege_label': self.Labels[d.privilege_type],
'with_grant': (self.model.get('grantee') != 'public' && d.with_grant), 'with_grant': (self.model.get('grantee') != 'PUBLIC' && d.with_grant),
'enable_with_grant': (self.model.get('grantee') != 'public' && d.privilege) 'enable_with_grant': (self.model.get('grantee') != 'PUBLIC' && d.privilege)
}); });
privilege = (privilege && d.privilege); privilege = (privilege && d.privilege);
with_grant = (with_grant && privilege && d.with_grant); with_grant = (with_grant && privilege && d.with_grant);
@ -395,8 +395,8 @@
'privilege_label': 'ALL', 'privilege_label': 'ALL',
'privilege_type': 'ALL', 'privilege_type': 'ALL',
'privilege': privilege, 'privilege': privilege,
'with_grant': (self.model.get('grantee') != 'public' && with_grant), 'with_grant': (self.model.get('grantee') != 'PUBLIC' && with_grant),
'enable_with_grant': (self.model.get('grantee') != 'public' && privilege), 'enable_with_grant': (self.model.get('grantee') != 'PUBLIC' && privilege),
'header': true 'header': true
})); }));
} }
@ -461,7 +461,7 @@
* We have clicked the ALL checkbox, we should be able to select * We have clicked the ALL checkbox, we should be able to select
* the grant options too. * the grant options too.
*/ */
if (grantee == 'public') { if (grantee == 'PUBLIC') {
$allGrants.prop('disabled', true); $allGrants.prop('disabled', true);
$elGrant.prop('disabled', true); $elGrant.prop('disabled', true);
} else { } else {
@ -531,7 +531,7 @@
$allPrivilege.prop('checked', false); $allPrivilege.prop('checked', false);
$allGrant.prop('disabled', true); $allGrant.prop('disabled', true);
$allGrant.prop('checked', false); $allGrant.prop('checked', false);
} else if (grantee != "public") { } else if (grantee != "PUBLIC") {
$elGrant.prop('disabled', false); $elGrant.prop('disabled', false);
} }
} else if (!checked) { } else if (!checked) {
@ -557,7 +557,7 @@
$allGrant.prop('disabled', false); $allGrant.prop('disabled', false);
$allGrant.prop('checked', true); $allGrant.prop('checked', true);
} }
} else if (grantee != "public") { } else if (grantee != "PUBLIC") {
$allGrant.prop('disabled', false); $allGrant.prop('disabled', false);
} }
} }

View File

@ -1,5 +1,5 @@
{### SQL to fetch privileges for tablespace ###} {### SQL to fetch privileges for tablespace ###}
SELECT 'spcacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, SELECT 'spcacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT

View File

@ -1,5 +1,5 @@
{### SQL to fetch privileges for tablespace ###} {### SQL to fetch privileges for tablespace ###}
SELECT 'spcacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, SELECT 'spcacl' as deftype, COALESCE(gt.rolname, 'PUBLIC') grantee, g.rolname grantor,
array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
FROM FROM
(SELECT (SELECT