Skip to content

HAS_EXTERNAL_*_PRIVILEGE

Note: These functions cannot be used in a query that has a FROM clause (with table references).

HAS_EXTERNAL_STORAGE_PRIVILEGE

Return true if the user has the specified privilege for the specified external storage object.

HAS_EXTERNAL_STORAGE_PRIVILEGE([role,] object, privilege)
role

If the role (or user) name is omitted, the function returns results for the current user.

object

Name of an existing external storage object.

privilege

Specify one of the following privileges:

  • DROP EXTERNAL STORAGE
  • USAGE EXTERNAL STORAGE

For example:

premdb=> select has_external_storage_privilege('bobr','premdbs3','drop external storage');
 has_external_storage_privilege 
--------------------------------
 t
(1 row)

HAS_EXTERNAL_FORMAT_PRIVILEGE

Return true if the user has the specified privilege for the specified external format object.

HAS_EXTERNAL_FORMAT_PRIVILEGE([role,] object, privilege)
role

If the role (or user) name is omitted, the function returns results for the current user.

object

Name of an existing external format object.

privilege

Specify one of the following privileges:

  • DROP EXTERNAL FORMAT
  • USAGE EXTERNAL FORMAT

For example:

premdb=> select has_external_format_privilege('backup1','premfiles','usage external format');
 has_external_format_privilege 
-------------------------------
 f
(1 row)

HAS_EXTERNAL_LOCATION_PRIVILEGE

Return true if the user has the specified privilege for the specified external location object.

HAS_EXTERNAL_LOCATION_PRIVILEGE([role,] object, privilege)
role
If the role (or user) name is omitted, the function returns results for the current user.
object
Name of an existing external location object.
privilege
Specify the following privilege: DROP EXTERNAL LOCATION.

For example:

premdb=> select has_external_location_privilege('bobr','premdbs3data','drop external location');
 has_external_location_privilege 
---------------------------------
 t
(1 row)