From: Alvaro Herrera Date: Fri, 12 May 2017 22:22:03 +0000 (-0300) Subject: getObjectDescription: support extended statistics X-Git-Tag: REL_10_BETA1~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e2af609e14ede1b5e0d73d59ed8548c76e1943a;p=postgresql getObjectDescription: support extended statistics This was missed in 7b504eb282ca. 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 --- diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index a9e529fba0..a373df743b 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -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;