Commit 5e2af609 authored by Alvaro Herrera's avatar Alvaro Herrera

getObjectDescription: support extended statistics

This was missed in 7b504eb2.

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
parent 50ee1c74
...@@ -3004,6 +3004,26 @@ getObjectDescription(const ObjectAddress *object) ...@@ -3004,6 +3004,26 @@ getObjectDescription(const ObjectAddress *object)
break; 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: case OCLASS_TRANSFORM:
{ {
HeapTuple trfTup; HeapTuple trfTup;
...@@ -3394,13 +3414,6 @@ getObjectDescription(const ObjectAddress *object) ...@@ -3394,13 +3414,6 @@ getObjectDescription(const ObjectAddress *object)
get_subscription_name(object->objectId)); get_subscription_name(object->objectId));
break; break;
} }
default:
appendStringInfo(&buffer, "unrecognized object %u %u %d",
object->classId,
object->objectId,
object->objectSubId);
break;
} }
return buffer.data; return buffer.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment