aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/typecmds.c18
-rw-r--r--src/backend/utils/adt/rangetypes.c17
2 files changed, 18 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 */
diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c
index 3326cb17c89..4b27d4317fb 100644
--- a/src/backend/utils/adt/rangetypes.c
+++ b/src/backend/utils/adt/rangetypes.c
@@ -1135,6 +1135,23 @@ hash_range(PG_FUNCTION_ARGS)
PG_RETURN_INT32(result);
}
+/* ANALYZE support */
+
+/* typanalyze function for range datatypes */
+Datum
+range_typanalyze(PG_FUNCTION_ARGS)
+{
+ /*
+ * For the moment, just punt and don't analyze range columns. If we
+ * get close to release without having a better answer, we could
+ * consider letting std_typanalyze do what it can ... but those stats
+ * are probably next door to useless for most activity with range
+ * columns, so it's not clear it's worth gathering them.
+ */
+ PG_RETURN_BOOL(false);
+}
+
+
/*
*----------------------------------------------------------
* CANONICAL FUNCTIONS