12.3. Retrieving Information About Proxy Tables #

This section describes how to retrieve proxy table names and the names of associated storages and shared directories.

The mapping between proxy tables and associated storages and shared directories is stored in the axe_storages and axe_folders internal tables of the axe schema on the Postgres Pro AXE server.

12.3.1. Retrieving All Proxy Tables and Associated Object Names #

Required privileges:

  • the USAGE privilege on the axe schema

  • the SELECT privilege on the axe_storages and axe_folders internal tables

Execute the following command on the Postgres Pro AXE server:

  SELECT
      storage_name AS object_name,
      'storage' AS object_type,
      proxy_oid::regclass::text AS proxy_table_name
  FROM axe.axe_storages
  UNION ALL
  SELECT
      folder_name AS object_name,
      'folder' AS object_type,
      proxy_oid::regclass::text AS proxy_table_name
  FROM axe.axe_folders
  ORDER BY object_type, object_name;

Proxy table names use the s_ prefix for storages and the f_ prefix for shared directories. In both cases, the prefix is followed by the object UUID.

The UUID part is quoted as a SQL identifier. The textual regclass representation can omit the schema name depending on search_path. Use the proxy OID for comparisons that must not depend on the output format.

12.3.2. Retrieving a Proxy Table Name Using an Object Name #

Required privileges:

  • the USAGE privilege on the axe schema

  • the SELECT privilege on the axe_storages or axe_folders internal table

Execute the following command on the Postgres Pro AXE server:

  SELECT proxy_oid::regclass::text AS proxy_table_name
  FROM axe.table_name
  WHERE object_name_column = 'object_name';

Where:

  • table_name: The name of the table that stores the mapping.

    Possible values:

    • axe_storages for storages

    • axe_folders for shared directories

  • object_name_column: The name of the column that stores the object name.

    Possible values:

    • storage_name for storages

    • folder_name for shared directories

  • object_name: The name of the storage or shared directory.

Example 12.1. Retrieving a Proxy Table Name for a Storage

  SELECT proxy_oid::regclass::text AS proxy_table_name
  FROM axe.axe_storages
  WHERE storage_name = 'axe_storage';

Example 12.2. Retrieving a Proxy Table Name for a Shared Directory

  SELECT proxy_oid::regclass::text AS proxy_table_name
  FROM axe.axe_folders
  WHERE folder_name = 'axe_folder';

12.3.3. Retrieving an Object Name Using a Proxy Table Name #

Required privileges:

  • the USAGE privilege on the axe and _axe_proxy schemas

  • the SELECT privilege on the axe_storages or axe_folders internal table

Execute the following command on the Postgres Pro AXE server:

  SELECT object_name
  FROM axe.table_name
  WHERE proxy_oid =
      '_axe_proxy."proxy_table_name"'::regclass::oid;

Where:

  • object_name: The name of the column that stores the object name.

    Possible values:

    • storage_name for storages

    • folder_name for shared directories

  • table_name: The name of the table that stores the mapping.

    Possible values:

    • axe_storages for storages

    • axe_folders for shared directories

  • proxy_table_name: The proxy table name with the s_ or f_ prefix.

Example 12.3. Retrieving a Storage Name

  SELECT storage_name
  FROM axe.axe_storages
  WHERE proxy_oid =
      '_axe_proxy."s_68e4bd9e-4bee-4ba6-8684-53d38cbc39c6"'::regclass::oid;

Example 12.4. Retrieving a Shared Directory Name

  SELECT folder_name
  FROM axe.axe_folders
  WHERE proxy_oid =
      '_axe_proxy."f_68e4bd9e-4bee-4ba6-8684-53d38cbc39c6"'::regclass::oid;

Casting a name to the regclass type raises an error if the relation does not exist.

FAQ