getObjectDescription: support extended statistics

This was missed in 7b504eb282.

Remove the "default:" clause in the switch, to avoid this problem in the
future.  Other switches involving the same enum should probably be
changed in the same way, but are not touched by this patch.

Discussion: https://postgr.es/m/20170512204800.iqt2uwyx3c32j45r@alvherre.pgsql
This commit is contained in:
Alvaro Herrera 2017-05-12 19:22:03 -03:00
parent 50ee1c7462
commit 5e2af609e1
1 changed files with 20 additions and 7 deletions

View File

@ -3004,6 +3004,26 @@ getObjectDescription(const ObjectAddress *object)
break;
}
case OCLASS_STATISTIC_EXT:
{
HeapTuple stxTup;
Form_pg_statistic_ext stxForm;
stxTup = SearchSysCache1(STATEXTOID,
ObjectIdGetDatum(object->objectId));
if (!HeapTupleIsValid(stxTup))
elog(ERROR, "could not find tuple for statistics object %u",
object->objectId);
stxForm = (Form_pg_statistic_ext) GETSTRUCT(stxTup);
appendStringInfo(&buffer, _("statistics object %s"),
NameStr(stxForm->stxname));
ReleaseSysCache(stxTup);
break;
}
case OCLASS_TRANSFORM:
{
HeapTuple trfTup;
@ -3394,13 +3414,6 @@ getObjectDescription(const ObjectAddress *object)
get_subscription_name(object->objectId));
break;
}
default:
appendStringInfo(&buffer, "unrecognized object %u %u %d",
object->classId,
object->objectId,
object->objectSubId);
break;
}
return buffer.data;