Support Migration Notice: To update migrated JIRA cases click here to open a new case use www.vmware.com/go/sr | vFabric Hyperic 5.7.0 is Now Available

Hyperic HQ

postgresql-plugin doesn't distinguish table names across schemas

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 4.5, 4.6
  • Fix Version/s: 4.6.5
  • Component/s: Plugins
  • Case Links:
  • HQ Fix Version:
    4.6.5 05-Jan-2012
  • Regression:
    No

Description

The plugin uses the following:

} else if (attr.equals("IndexSpaceUsed")) {
                return "SELECT SUM(relpages) * 8 FROM pg_class WHERE " +
                    "relname IN (SELECT indexrelname FROM " +
                    "pg_stat_user_indexes WHERE relname='" +
                    table.toLowerCase() + "')";
            }

If multiple schemas have the same table name this query will not be on the proper table.

In addition the .toLowerCase() shouldn't be there since postgresql allows case sensitive table names.

Activity

Hide
Maya Anderson added a comment -

The table and index names detected by PostgreSQL plugin are now prepended by schema name and are case sensitive. Achieved this by adding schema parameters to all the relevant queries.

Tested by creating tables with the same name in multiple schemas in the PostgreSQL DB installation (on Windows), which were successfully detected and monitored by the plugin. Did the same with tables that included uppercase letters in their names.

Show
Maya Anderson added a comment - The table and index names detected by PostgreSQL plugin are now prepended by schema name and are case sensitive. Achieved this by adding schema parameters to all the relevant queries. Tested by creating tables with the same name in multiple schemas in the PostgreSQL DB installation (on Windows), which were successfully detected and monitored by the plugin. Did the same with tables that included uppercase letters in their names.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:
    Last comment:
    2 years, 15 weeks ago