summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-04-17 18:34:29 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-04-17 18:34:29 -0300
commitee6922112e9b3c02b995bd1d838c9a261f060133 (patch)
tree2d8678c97967dbdccdfa692a4b75fdd5f21cbe06 /src/backend/utils/adt/ruleutils.c
parent8c5cdb7f4f6e1d6a6104cb58ce4f23453891651b (diff)
Rename columns in new pg_statistic_ext catalog
The new catalog reused a column prefix "sta" from pg_statistic, but this is undesirable, so change the catalog to use prefix "stx" instead. Also, rename the column that lists enabled statistic kinds as "stxkind" rather than "enabled". Discussion: https://postgr.es/m/CAKJS1f_2t5jhSN7huYRFH3w3rrHfG2QU7hiUHsu-Vdjd1rYT3w@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 5f11af2ee6e..184e5daa05b 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -1473,23 +1473,23 @@ pg_get_statisticsext_worker(Oid statextid, bool missing_ok)
initStringInfo(&buf);
- nsp = get_namespace_name(statextrec->stanamespace);
+ nsp = get_namespace_name(statextrec->stxnamespace);
appendStringInfo(&buf, "CREATE STATISTICS %s",
quote_qualified_identifier(nsp,
- NameStr(statextrec->staname)));
+ NameStr(statextrec->stxname)));
/*
- * Lookup the staenabled column so that we know how to handle the WITH
+ * Lookup the stxkind column so that we know how to handle the WITH
* clause.
*/
datum = SysCacheGetAttr(STATEXTOID, statexttup,
- Anum_pg_statistic_ext_staenabled, &isnull);
+ Anum_pg_statistic_ext_stxkind, &isnull);
Assert(!isnull);
arr = DatumGetArrayTypeP(datum);
if (ARR_NDIM(arr) != 1 ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != CHAROID)
- elog(ERROR, "staenabled is not a 1-D char array");
+ elog(ERROR, "stxkind is not a 1-D char array");
enabled = (char *) ARR_DATA_PTR(arr);
ndistinct_enabled = false;
@@ -1523,21 +1523,21 @@ pg_get_statisticsext_worker(Oid statextid, bool missing_ok)
appendStringInfoString(&buf, " ON (");
- for (colno = 0; colno < statextrec->stakeys.dim1; colno++)
+ for (colno = 0; colno < statextrec->stxkeys.dim1; colno++)
{
- AttrNumber attnum = statextrec->stakeys.values[colno];
+ AttrNumber attnum = statextrec->stxkeys.values[colno];
char *attname;
if (colno > 0)
appendStringInfoString(&buf, ", ");
- attname = get_relid_attribute_name(statextrec->starelid, attnum);
+ attname = get_relid_attribute_name(statextrec->stxrelid, attnum);
appendStringInfoString(&buf, quote_identifier(attname));
}
appendStringInfo(&buf, ") FROM %s",
- generate_relation_name(statextrec->starelid, NIL));
+ generate_relation_name(statextrec->stxrelid, NIL));
ReleaseSysCache(statexttup);