diff --git a/pgadmin/frm/frmMaintenance.cpp b/pgadmin/frm/frmMaintenance.cpp index 6d347cf..c39ac11 100644 --- a/pgadmin/frm/frmMaintenance.cpp +++ b/pgadmin/frm/frmMaintenance.cpp @@ -192,7 +192,7 @@ wxString frmMaintenance::GetSql() if (object->GetMetaType() == PGM_INDEX || object->GetMetaType() == PGM_UNIQUE || object->GetMetaType() == PGM_PRIMARYKEY) { - sql += object->GetTable()->GetQuotedFullIdentifier(); + sql += object->GetSchema()->GetQuotedFullIdentifier(); if (conn->BackendMinimumVersion(8, 4)) { sql += wxT(" USING ") + object->GetQuotedIdentifier(); diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp index 49f6ea3..ef15c22 100644 --- a/pgadmin/schema/pgIndex.cpp +++ b/pgadmin/schema/pgIndex.cpp @@ -698,7 +698,7 @@ pgIndexBaseCollection::pgIndexBaseCollection(pgaFactory *factory, pgSchema *sch) void pgIndexBaseCollection::ShowStatistics(frmMain *form, ctlListView *statistics) { - wxLogInfo(wxT("Displaying statistics for indexes on ") + GetTable()->GetName()); + wxLogInfo(wxT("Displaying statistics for indexes on ") + GetSchema()->GetName()); bool hasSize = GetConnection()->HasFeature(FEATURE_SIZE); @@ -722,8 +722,8 @@ void pgIndexBaseCollection::ShowStatistics(frmMain *form, ctlListView *statistic wxT(" JOIN pg_class cls ON cls.oid=indexrelid\n") wxT(" LEFT JOIN pg_depend dep ON (dep.classid = cls.tableoid AND dep.objid = cls.oid AND dep.refobjsubid = '0' AND dep.refclassid=(SELECT oid FROM pg_class WHERE relname='pg_constraint'))\n") wxT(" LEFT OUTER JOIN pg_constraint con ON (con.tableoid = dep.refclassid AND con.oid = dep.refobjid)\n") - wxT(" WHERE schemaname = ") + qtDbString(GetTable()->GetSchema()->GetName()) - + wxT(" AND stat.relname = ") + qtDbString(GetTable()->GetName()) + wxT(" WHERE schemaname = ") + qtDbString(GetSchema()->GetSchema()->GetName()) + + wxT(" AND stat.relname = ") + qtDbString(GetSchema()->GetName()) + wxT(" AND con.contype IS NULL") + wxT("\n ORDER BY indexrelname"); diff --git a/pgadmin/schema/pgObject.cpp b/pgadmin/schema/pgObject.cpp index 6d86a2e..392a01d 100644 --- a/pgadmin/schema/pgObject.cpp +++ b/pgadmin/schema/pgObject.cpp @@ -1443,7 +1443,10 @@ wxString pgSchemaObject::GetFullIdentifier() const wxString pgSchemaObject::GetQuotedFullIdentifier() const { - return schema->GetQuotedPrefix() + GetQuotedIdentifier(); + if (schema->GetTypeName() == wxT("Table")) + return schema->GetSchema()->GetQuotedPrefix() + GetQuotedIdentifier(); + else + return schema->GetQuotedPrefix() + GetQuotedIdentifier(); }