diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-11-23 00:03:22 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-11-23 00:03:22 -0500 |
commit | 74c1723fc8dca2d70576ef2f0a66f4a7c99c173a (patch) | |
tree | a55cb1107a595453641f67d38774550969ed479e /src/backend/commands/typecmds.c | |
parent | df73584431e7edb1dd76578777bd0fcc17b916a1 (diff) | |
download | postgresql-74c1723fc8dca2d70576ef2f0a66f4a7c99c173a.tar.gz postgresql-74c1723fc8dca2d70576ef2f0a66f4a7c99c173a.zip |
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.
Diffstat (limited to 'src/backend/commands/typecmds.c')
-rw-r--r-- | src/backend/commands/typecmds.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index 1516a2aba4f..ee75600a12c 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -1225,12 +1225,10 @@ DefineRange(CreateRangeStmt *stmt) List *rangeCollationName = NIL; List *rangeCanonicalName = NIL; List *rangeSubtypeDiffName = NIL; - List *rangeAnalyzeName = NIL; Oid rangeSubOpclass; Oid rangeCollation; regproc rangeCanonical; regproc rangeSubtypeDiff; - regproc rangeAnalyze; int16 subtyplen; bool subtypbyval; char subtypalign; @@ -1326,14 +1324,6 @@ DefineRange(CreateRangeStmt *stmt) errmsg("conflicting or redundant options"))); rangeSubtypeDiffName = defGetQualifiedName(defel); } - else if (pg_strcasecmp(defel->defname, "analyze") == 0) - { - if (rangeAnalyzeName != NIL) - ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("conflicting or redundant options"))); - rangeAnalyzeName = defGetQualifiedName(defel); - } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), @@ -1386,12 +1376,6 @@ DefineRange(CreateRangeStmt *stmt) else rangeSubtypeDiff = InvalidOid; - if (rangeAnalyzeName != NIL) - rangeAnalyze = findTypeAnalyzeFunction(rangeAnalyzeName, - typoid); - else - rangeAnalyze = InvalidOid; - get_typlenbyvalalign(rangeSubtype, &subtyplen, &subtypbyval, &subtypalign); @@ -1420,7 +1404,7 @@ DefineRange(CreateRangeStmt *stmt) F_RANGE_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ - rangeAnalyze, /* analyze procedure */ + F_RANGE_TYPANALYZE, /* analyze procedure */ InvalidOid, /* element type ID - none */ false, /* this is not an array type */ rangeArrayOid, /* array type we are about to create */ |