mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +03:00
Make stxstattarget nullable
To match attstattarget change (commit 4f622503d6). The logic inside
CreateStatistics() is clarified a bit compared to that previous patch,
and so here we also update ATExecSetStatistics() to match.
Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/4da8d211-d54d-44b9-9847-f2a9f1184c76@eisentraut.org
This commit is contained in:
@@ -454,13 +454,15 @@ fetch_statentries_for_relation(Relation pg_statext, Oid relid)
|
||||
entry->statOid = staForm->oid;
|
||||
entry->schema = get_namespace_name(staForm->stxnamespace);
|
||||
entry->name = pstrdup(NameStr(staForm->stxname));
|
||||
entry->stattarget = staForm->stxstattarget;
|
||||
for (i = 0; i < staForm->stxkeys.dim1; i++)
|
||||
{
|
||||
entry->columns = bms_add_member(entry->columns,
|
||||
staForm->stxkeys.values[i]);
|
||||
}
|
||||
|
||||
datum = SysCacheGetAttr(STATEXTOID, htup, Anum_pg_statistic_ext_stxstattarget, &isnull);
|
||||
entry->stattarget = isnull ? -1 : DatumGetInt16(datum);
|
||||
|
||||
/* decode the stxkind char array into a list of chars */
|
||||
datum = SysCacheGetAttrNotNull(STATEXTOID, htup,
|
||||
Anum_pg_statistic_ext_stxkind);
|
||||
|
||||
Reference in New Issue
Block a user