1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Remove user-selectable ANALYZE option for range types.

It's not clear that a per-datatype typanalyze function would be any more
useful than a generic typanalyze for ranges.  What *is* clear is that
letting unprivileged users select typanalyze functions is a crash risk or
worse.  So remove the option from CREATE TYPE AS RANGE, and instead put in
a generic typanalyze function for ranges.  The generic function does
nothing as yet, but hopefully we'll improve that before 9.2 release.
This commit is contained in:
Tom Lane
2011-11-23 00:03:22 -05:00
parent df73584431
commit 74c1723fc8
8 changed files with 36 additions and 40 deletions

View File

@@ -7482,11 +7482,11 @@ dumpRangeType(Archive *fout, TypeInfo *tyinfo)
"opc.opcdefault, "
"CASE WHEN rngcollation = st.typcollation THEN 0 "
" ELSE rngcollation END AS collation, "
"rngcanonical, rngsubdiff, t.typanalyze "
"FROM pg_catalog.pg_type t, pg_catalog.pg_type st, "
" pg_catalog.pg_opclass opc, pg_catalog.pg_range r "
"WHERE t.oid = rngtypid AND st.oid = rngsubtype AND "
" opc.oid = rngsubopc AND rngtypid = '%u'",
"rngcanonical, rngsubdiff "
"FROM pg_catalog.pg_range r, pg_catalog.pg_type st, "
" pg_catalog.pg_opclass opc "
"WHERE st.oid = rngsubtype AND opc.oid = rngsubopc AND "
"rngtypid = '%u'",
tyinfo->dobj.catId.oid);
res = PQexec(g_conn, query->data);
@@ -7552,10 +7552,6 @@ dumpRangeType(Archive *fout, TypeInfo *tyinfo)
if (strcmp(procname, "-") != 0)
appendPQExpBuffer(q, ",\n subtype_diff = %s", procname);
procname = PQgetvalue(res, 0, PQfnumber(res, "typanalyze"));
if (strcmp(procname, "-") != 0)
appendPQExpBuffer(q, ",\n analyze = %s", procname);
appendPQExpBuffer(q, "\n);\n");
appendPQExpBuffer(labelq, "TYPE %s", fmtId(tyinfo->dobj.name));