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
(SELECT
d.grantee, d.grantor, d.is_grantable,

View File

@ -2,7 +2,7 @@
{% if fsid %}
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
LEFT JOIN pg_authid a ON a.oid = u.umuser WHERE u.umserver = {{ fsid }}::OID
)

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
(SELECT
d.grantee, d.grantor, d.is_grantable,

View File

@ -2,7 +2,7 @@
{% if fsid %}
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
LEFT JOIN pg_authid a ON a.oid = u.umuser WHERE u.umserver = {{ fsid }}::OID
)

View File

@ -336,9 +336,6 @@ class UserMappingView(PGChildNodeView):
if not status:
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:
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 %}
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
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 %}
)

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
(SELECT
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
(SELECT
d.grantee, d.grantor, d.is_grantable,

View File

@ -314,7 +314,7 @@ class LanguageView(PGChildNodeView):
# if no acl found then by default add public
if res['rows'][0]['acl'] is None:
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']['privileges'] = [{'privilege_type': 'U', 'privilege': True, 'with_grant': False}]
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
FROM
(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
FROM
(SELECT

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
SELECT
COALESCE(gt.rolname, 'public') AS grantee,
COALESCE(gt.rolname, 'PUBLIC') AS grantee,
g.rolname AS grantor, array_agg(privilege_type) AS privileges,
array_agg(is_grantable) AS grantable
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
(SELECT
d.grantee, d.grantor, d.is_grantable,

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
(SELECT
d.grantee, d.grantor, d.is_grantable,

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
(SELECT
d.grantee, d.grantor, d.is_grantable,

View File

@ -1,5 +1,5 @@
{### 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
FROM
(SELECT

View File

@ -1,5 +1,5 @@
{### 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
FROM
(SELECT

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl'
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
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,

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -6,7 +6,7 @@ SELECT
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
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,

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl'
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
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,

View File

@ -1,6 +1,6 @@
{# Fetch privileges for schema #}
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,
array_agg(b.is_grantable) AS grantable
FROM

View File

@ -6,7 +6,7 @@ SELECT
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
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,

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
(SELECT
d.grantee, d.grantor, d.is_grantable,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
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,
array_agg(is_grantable) AS grantable
FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl'
WHEN 'T' THEN 'deftypeacl'
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
(SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,5 +1,5 @@
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,
array_agg(is_grantable) AS grantable
FROM

View File

@ -5,7 +5,7 @@ SELECT
WHEN 'f' THEN 'deffuncacl'
WHEN 'T' THEN 'deftypeacl'
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
(SELECT
(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,

View File

@ -1,5 +1,5 @@
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,
array_agg(is_grantable) AS grantable
FROM

View File

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

View File

@ -1,5 +1,5 @@
{### 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
FROM
(SELECT

View File

@ -1,5 +1,5 @@
{### 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
FROM
(SELECT