diff -rc src/backend/catalog/heap.c /home/pg74/pg_cvs/pgsql/src/backend/catalog/heap.c *** src/backend/catalog/heap.c Fri Jan 23 15:45:54 2004 --- /home/pg74/pg_cvs/pgsql/src/backend/catalog/heap.c Thu Jan 22 15:02:06 2004 *************** *** 689,694 **** --- 689,695 ---- F_RECORD_OUT, /* output procedure */ F_RECORD_RECV, /* receive procedure */ F_RECORD_SEND, /* send procedure */ + F_PG_ANALYZE_ALG_DEFAULT, /* analyze procedure */ InvalidOid, /* array element type - irrelevant */ InvalidOid, /* domain base type - irrelevant */ NULL, /* default type value - none */ diff -rc src/backend/catalog/pg_type.c /home/pg74/pg_cvs/pgsql/src/backend/catalog/pg_type.c *** src/backend/catalog/pg_type.c Fri Jan 23 15:45:54 2004 --- /home/pg74/pg_cvs/pgsql/src/backend/catalog/pg_type.c Thu Jan 22 13:07:47 2004 *************** *** 86,91 **** --- 86,92 ---- values[i++] = ObjectIdGetDatum(InvalidOid); /* typoutput */ values[i++] = ObjectIdGetDatum(InvalidOid); /* typreceive */ values[i++] = ObjectIdGetDatum(InvalidOid); /* typsend */ + values[i++] = ObjectIdGetDatum(InvalidOid); /* typanalyze */ values[i++] = CharGetDatum('i'); /* typalign */ values[i++] = CharGetDatum('p'); /* typstorage */ values[i++] = BoolGetDatum(false); /* typnotnull */ *************** *** 121,126 **** --- 122,128 ---- InvalidOid, InvalidOid, InvalidOid, + InvalidOid, NULL, false); *************** *** 157,162 **** --- 159,165 ---- Oid outputProcedure, Oid receiveProcedure, Oid sendProcedure, + Oid analyzeProcedure, Oid elementType, Oid baseType, const char *defaultTypeValue, /* human readable rep */ *************** *** 236,241 **** --- 239,245 ---- values[i++] = ObjectIdGetDatum(outputProcedure); /* typoutput */ values[i++] = ObjectIdGetDatum(receiveProcedure); /* typreceive */ values[i++] = ObjectIdGetDatum(sendProcedure); /* typsend */ + values[i++] = ObjectIdGetDatum(analyzeProcedure); /* typanalyze */ values[i++] = CharGetDatum(alignment); /* typalign */ values[i++] = CharGetDatum(storage); /* typstorage */ values[i++] = BoolGetDatum(typeNotNull); /* typnotnull */ *************** *** 332,337 **** --- 336,342 ---- outputProcedure, receiveProcedure, sendProcedure, + analyzeProcedure, elementType, baseType, (defaultTypeBin ? *************** *** 366,371 **** --- 371,377 ---- Oid outputProcedure, Oid receiveProcedure, Oid sendProcedure, + Oid analyzeProcedure, Oid elementType, Oid baseType, Node *defaultExpr, *************** *** 424,429 **** --- 430,444 ---- referenced.objectSubId = 0; recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); } + + /* Normal dependency on analyze function */ + if (OidIsValid(analyzeProcedure)) + { + referenced.classId = RelOid_pg_proc; + referenced.objectId = analyzeProcedure; + referenced.objectSubId = 0; + recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); + } /* * If the type is a rowtype for a relation, mark it as internally diff -rc src/backend/commands/analyze.c /home/pg74/pg_cvs/pgsql/src/backend/commands/analyze.c *** src/backend/commands/analyze.c Fri Jan 23 15:45:54 2004 --- /home/pg74/pg_cvs/pgsql/src/backend/commands/analyze.c Fri Jan 23 09:39:00 2004 *************** *** 39,54 **** /* - * Analysis algorithms supported - */ - typedef enum - { - ALG_MINIMAL = 1, /* Compute only most-common-values */ - ALG_SCALAR /* Compute MCV, histogram, sort - * correlation */ - } AlgCode; - - /* * To avoid consuming too much memory during analysis and/or too much space * in the resulting pg_statistic rows, we ignore varlena datums that are wider * than WIDTH_THRESHOLD (after detoasting!). This is legitimate for MCV --- 39,44 ---- *************** *** 59,98 **** */ #define WIDTH_THRESHOLD 1024 - /* - * We build one of these structs for each attribute (column) that is to be - * analyzed. The struct and subsidiary data are in anl_context, - * so they live until the end of the ANALYZE operation. - */ - typedef struct - { - /* These fields are set up by examine_attribute */ - int attnum; /* attribute number */ - AlgCode algcode; /* Which algorithm to use for this column */ - int minrows; /* Minimum # of rows wanted for stats */ - Form_pg_attribute attr; /* copy of pg_attribute row for column */ - Form_pg_type attrtype; /* copy of pg_type row for column */ - Oid eqopr; /* '=' operator for datatype, if any */ - Oid eqfunc; /* and associated function */ - Oid ltopr; /* '<' operator for datatype, if any */ - - /* - * These fields are filled in by the actual statistics-gathering - * routine - */ - bool stats_valid; - float4 stanullfrac; /* fraction of entries that are NULL */ - int4 stawidth; /* average width */ - float4 stadistinct; /* # distinct values */ - int2 stakind[STATISTIC_NUM_SLOTS]; - Oid staop[STATISTIC_NUM_SLOTS]; - int numnumbers[STATISTIC_NUM_SLOTS]; - float4 *stanumbers[STATISTIC_NUM_SLOTS]; - int numvalues[STATISTIC_NUM_SLOTS]; - Datum *stavalues[STATISTIC_NUM_SLOTS]; - } VacAttrStats; - - typedef struct { Datum value; /* a data value */ --- 49,54 ---- *************** *** 113,123 **** /* Default statistics target (GUC parameter) */ int default_statistics_target = 10; - static int elevel = -1; static MemoryContext anl_context = NULL; /* context information for compare_scalars() */ static FmgrInfo *datumCmpFn; static SortFunctionKind datumCmpFnKind; --- 69,79 ---- /* Default statistics target (GUC parameter) */ int default_statistics_target = 10; static int elevel = -1; static MemoryContext anl_context = NULL; + /* context information for compare_scalars() */ static FmgrInfo *datumCmpFn; static SortFunctionKind datumCmpFnKind; *************** *** 157,162 **** --- 113,122 ---- numrows; double totalrows; HeapTuple *rows; + void (*analyze_algptr)(VacAttrStats *, + TupleDesc, double, + HeapTuple *, int); + if (vacstmt->verbose) elevel = INFO; *************** *** 313,318 **** --- 273,279 ---- rows = (HeapTuple *) palloc(targrows * sizeof(HeapTuple)); numrows = acquire_sample_rows(onerel, rows, targrows, &totalrows); + /* * If we are running a standalone ANALYZE, update pages/tuples stats * in pg_class. We have the accurate page count from heap_beginscan, *************** *** 345,363 **** old_context = MemoryContextSwitchTo(col_context); for (i = 0; i < attr_cnt; i++) { ! switch (vacattrstats[i]->algcode) ! { ! case ALG_MINIMAL: ! compute_minimal_stats(vacattrstats[i], ! onerel->rd_att, totalrows, ! rows, numrows); ! break; ! case ALG_SCALAR: ! compute_scalar_stats(vacattrstats[i], ! onerel->rd_att, totalrows, ! rows, numrows); ! break; ! } MemoryContextResetAndDeleteChildren(col_context); } MemoryContextSwitchTo(old_context); --- 306,319 ---- old_context = MemoryContextSwitchTo(col_context); for (i = 0; i < attr_cnt; i++) { ! ! /* Call the statisical computation algorithm */ ! analyze_algptr = vacattrstats[i]->algfunc; ! ! (*analyze_algptr)(vacattrstats[i], ! onerel->rd_att, totalrows, ! rows, numrows); ! MemoryContextResetAndDeleteChildren(col_context); } MemoryContextSwitchTo(old_context); *************** *** 386,400 **** * Determine whether the column is analyzable; if so, create and initialize * a VacAttrStats struct for it. If not, return NULL. */ static VacAttrStats * examine_attribute(Relation onerel, int attnum) { Form_pg_attribute attr = onerel->rd_att->attrs[attnum - 1]; ! Operator func_operator; HeapTuple typtuple; - Oid eqopr = InvalidOid; - Oid eqfunc = InvalidOid; - Oid ltopr = InvalidOid; VacAttrStats *stats; /* Don't analyze dropped columns */ --- 342,354 ---- * Determine whether the column is analyzable; if so, create and initialize * a VacAttrStats struct for it. If not, return NULL. */ + static VacAttrStats * examine_attribute(Relation onerel, int attnum) { Form_pg_attribute attr = onerel->rd_att->attrs[attnum - 1]; ! Datum result; HeapTuple typtuple; VacAttrStats *stats; /* Don't analyze dropped columns */ *************** *** 405,429 **** if (attr->attstattarget == 0) return NULL; - /* If column has no "=" operator, we can't do much of anything */ - func_operator = equality_oper(attr->atttypid, true); - if (func_operator != NULL) - { - eqopr = oprid(func_operator); - eqfunc = oprfuncid(func_operator); - ReleaseSysCache(func_operator); - } - if (!OidIsValid(eqfunc)) - return NULL; - /* ! * If we have "=" then we're at least able to do the minimal ! * algorithm, so start filling in a VacAttrStats struct. */ stats = (VacAttrStats *) palloc0(sizeof(VacAttrStats)); stats->attnum = attnum; stats->attr = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE); memcpy(stats->attr, attr, ATTRIBUTE_TUPLE_SIZE); typtuple = SearchSysCache(TYPEOID, ObjectIdGetDatum(attr->atttypid), 0, 0, 0); --- 359,374 ---- if (attr->attstattarget == 0) return NULL; /* ! * Create a VacAttrStats structure with some sensible defaults and also ! * pointers to the attribute and type information for the column */ stats = (VacAttrStats *) palloc0(sizeof(VacAttrStats)); stats->attnum = attnum; stats->attr = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE); memcpy(stats->attr, attr, ATTRIBUTE_TUPLE_SIZE); + stats->anl_context = anl_context; + stats->minrows = 0; typtuple = SearchSysCache(TYPEOID, ObjectIdGetDatum(attr->atttypid), 0, 0, 0); *************** *** 432,452 **** stats->attrtype = (Form_pg_type) palloc(sizeof(FormData_pg_type)); memcpy(stats->attrtype, GETSTRUCT(typtuple), sizeof(FormData_pg_type)); ReleaseSysCache(typtuple); ! stats->eqopr = eqopr; ! stats->eqfunc = eqfunc; /* If the attstattarget column is negative, use the default value */ if (stats->attr->attstattarget < 0) stats->attr->attstattarget = default_statistics_target; /* Is there a "<" operator with suitable semantics? */ ! func_operator = ordering_oper(attr->atttypid, true); if (func_operator != NULL) { ltopr = oprid(func_operator); ReleaseSysCache(func_operator); } - stats->ltopr = ltopr; /* * Determine the algorithm to use (this will get more complicated --- 377,445 ---- stats->attrtype = (Form_pg_type) palloc(sizeof(FormData_pg_type)); memcpy(stats->attrtype, GETSTRUCT(typtuple), sizeof(FormData_pg_type)); ReleaseSysCache(typtuple); ! ! /* Invoke the custom analyze function */ ! result = OidFunctionCall1(stats->attrtype->typanalyze, PointerGetDatum(stats)); ! ! /* If the analyze function returned false then the column cannot be analyzed */ ! if (DatumGetBool(result) == false) ! { ! /* Free the type and attribute structures */ ! pfree(stats->attr); ! pfree(stats->attrtype); ! return NULL; ! } ! else ! { ! return stats; ! } ! } ! ! ! /* ! * pg_analyze_alg_default ! * ! * The default algorithm for generating data statistics for the planner ! * ! */ ! ! PG_FUNCTION_INFO_V1(pg_analyze_alg_default); ! Datum pg_analyze_alg_default(PG_FUNCTION_ARGS) ! { ! /* ! * This Datum function should return a BOOL indicating whether or not the ! * column is analyzable after setting a valid algfunc pointer and minrows value ! */ ! ! VacAttrStats *stats = (VacAttrStats *)PG_GETARG_POINTER(0); ! Operator func_operator; ! Oid eqfunc = InvalidOid; ! Oid ltopr = InvalidOid; ! ! ! /* If column has no "=" operator, we can't do much of anything */ ! func_operator = equality_oper(stats->attr->atttypid, true); ! if (func_operator != NULL) ! { ! eqfunc = oprfuncid(func_operator); ! ReleaseSysCache(func_operator); ! } ! ! if (!OidIsValid(eqfunc)) ! PG_RETURN_BOOL(false); ! /* If the attstattarget column is negative, use the default value */ if (stats->attr->attstattarget < 0) stats->attr->attstattarget = default_statistics_target; /* Is there a "<" operator with suitable semantics? */ ! func_operator = ordering_oper(stats->attr->atttypid, true); if (func_operator != NULL) { ltopr = oprid(func_operator); ReleaseSysCache(func_operator); } /* * Determine the algorithm to use (this will get more complicated *************** *** 455,461 **** if (OidIsValid(ltopr)) { /* Seems to be a scalar datatype */ ! stats->algcode = ALG_SCALAR; /*-------------------- * The following choice of minrows is based on the paper * "Random sampling for histogram construction: how much is enough?" --- 448,454 ---- if (OidIsValid(ltopr)) { /* Seems to be a scalar datatype */ ! stats->algfunc = compute_scalar_stats; /*-------------------- * The following choice of minrows is based on the paper * "Random sampling for histogram construction: how much is enough?" *************** *** 480,493 **** else { /* Can't do much but the minimal stuff */ ! stats->algcode = ALG_MINIMAL; /* Might as well use the same minrows as above */ stats->minrows = 300 * stats->attr->attstattarget; } ! return stats; } /* * acquire_sample_rows -- acquire a random sample of rows from the table * --- 473,488 ---- else { /* Can't do much but the minimal stuff */ ! stats->algfunc = compute_minimal_stats; /* Might as well use the same minrows as above */ stats->minrows = 300 * stats->attr->attstattarget; } ! /* A valid algfunc and minrows has been set */ ! PG_RETURN_BOOL(true); } + /* * acquire_sample_rows -- acquire a random sample of rows from the table * *************** *** 890,895 **** --- 885,894 ---- int track_cnt, track_max; int num_mcv = stats->attr->attstattarget; + Operator func_operator; + Oid eqopr; + Oid eqfunc; + /* * We track up to 2*n values for an n-element MCV list; but at least *************** *** 901,907 **** track = (TrackItem *) palloc(track_max * sizeof(TrackItem)); track_cnt = 0; ! fmgr_info(stats->eqfunc, &f_cmpeq); for (i = 0; i < numrows; i++) { --- 900,912 ---- track = (TrackItem *) palloc(track_max * sizeof(TrackItem)); track_cnt = 0; ! /* Look up the = operator and function */ ! func_operator = equality_oper(stats->attr->atttypid, true); ! eqfunc = oprfuncid(func_operator); ! eqopr = oprid(func_operator); ! ReleaseSysCache(func_operator); ! ! fmgr_info(eqfunc, &f_cmpeq); for (i = 0; i < numrows; i++) { *************** *** 1137,1143 **** float4 *mcv_freqs; /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(anl_context); mcv_values = (Datum *) palloc(num_mcv * sizeof(Datum)); mcv_freqs = (float4 *) palloc(num_mcv * sizeof(float4)); for (i = 0; i < num_mcv; i++) --- 1142,1148 ---- float4 *mcv_freqs; /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(stats->anl_context); mcv_values = (Datum *) palloc(num_mcv * sizeof(Datum)); mcv_freqs = (float4 *) palloc(num_mcv * sizeof(float4)); for (i = 0; i < num_mcv; i++) *************** *** 1150,1156 **** MemoryContextSwitchTo(old_context); stats->stakind[0] = STATISTIC_KIND_MCV; ! stats->staop[0] = stats->eqopr; stats->stanumbers[0] = mcv_freqs; stats->numnumbers[0] = num_mcv; stats->stavalues[0] = mcv_values; --- 1155,1161 ---- MemoryContextSwitchTo(old_context); stats->stakind[0] = STATISTIC_KIND_MCV; ! stats->staop[0] = eqopr; stats->stanumbers[0] = mcv_freqs; stats->numnumbers[0] = num_mcv; stats->stavalues[0] = mcv_values; *************** *** 1199,1210 **** int track_cnt = 0; int num_mcv = stats->attr->attstattarget; int num_bins = stats->attr->attstattarget; values = (ScalarItem *) palloc(numrows * sizeof(ScalarItem)); tupnoLink = (int *) palloc(numrows * sizeof(int)); track = (ScalarMCVItem *) palloc(num_mcv * sizeof(ScalarMCVItem)); ! SelectSortFunction(stats->ltopr, &cmpFn, &cmpFnKind); fmgr_info(cmpFn, &f_cmpfn); /* Initial scan to find sortable values */ --- 1204,1228 ---- int track_cnt = 0; int num_mcv = stats->attr->attstattarget; int num_bins = stats->attr->attstattarget; + Operator func_operator; + Oid eqopr; + Oid ltopr; values = (ScalarItem *) palloc(numrows * sizeof(ScalarItem)); tupnoLink = (int *) palloc(numrows * sizeof(int)); track = (ScalarMCVItem *) palloc(num_mcv * sizeof(ScalarMCVItem)); ! /* Look up the < and = operators */ ! func_operator = equality_oper(stats->attr->atttypid, true); ! eqopr = oprid(func_operator); ! ReleaseSysCache(func_operator); ! ! func_operator = ordering_oper(stats->attr->atttypid, true); ! ltopr = oprid(func_operator); ! ReleaseSysCache(func_operator); ! ! ! SelectSortFunction(ltopr, &cmpFn, &cmpFnKind); fmgr_info(cmpFn, &f_cmpfn); /* Initial scan to find sortable values */ *************** *** 1469,1475 **** float4 *mcv_freqs; /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(anl_context); mcv_values = (Datum *) palloc(num_mcv * sizeof(Datum)); mcv_freqs = (float4 *) palloc(num_mcv * sizeof(float4)); for (i = 0; i < num_mcv; i++) --- 1487,1493 ---- float4 *mcv_freqs; /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(stats->anl_context); mcv_values = (Datum *) palloc(num_mcv * sizeof(Datum)); mcv_freqs = (float4 *) palloc(num_mcv * sizeof(float4)); for (i = 0; i < num_mcv; i++) *************** *** 1482,1488 **** MemoryContextSwitchTo(old_context); stats->stakind[slot_idx] = STATISTIC_KIND_MCV; ! stats->staop[slot_idx] = stats->eqopr; stats->stanumbers[slot_idx] = mcv_freqs; stats->numnumbers[slot_idx] = num_mcv; stats->stavalues[slot_idx] = mcv_values; --- 1500,1506 ---- MemoryContextSwitchTo(old_context); stats->stakind[slot_idx] = STATISTIC_KIND_MCV; ! stats->staop[slot_idx] = eqopr; stats->stanumbers[slot_idx] = mcv_freqs; stats->numnumbers[slot_idx] = num_mcv; stats->stavalues[slot_idx] = mcv_values; *************** *** 1555,1561 **** Assert(nvals >= num_hist); /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(anl_context); hist_values = (Datum *) palloc(num_hist * sizeof(Datum)); for (i = 0; i < num_hist; i++) { --- 1573,1579 ---- Assert(nvals >= num_hist); /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(stats->anl_context); hist_values = (Datum *) palloc(num_hist * sizeof(Datum)); for (i = 0; i < num_hist; i++) { *************** *** 1569,1575 **** MemoryContextSwitchTo(old_context); stats->stakind[slot_idx] = STATISTIC_KIND_HISTOGRAM; ! stats->staop[slot_idx] = stats->ltopr; stats->stavalues[slot_idx] = hist_values; stats->numvalues[slot_idx] = num_hist; slot_idx++; --- 1587,1593 ---- MemoryContextSwitchTo(old_context); stats->stakind[slot_idx] = STATISTIC_KIND_HISTOGRAM; ! stats->staop[slot_idx] = ltopr; stats->stavalues[slot_idx] = hist_values; stats->numvalues[slot_idx] = num_hist; slot_idx++; *************** *** 1584,1590 **** corr_x2sum; /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(anl_context); corrs = (float4 *) palloc(sizeof(float4)); MemoryContextSwitchTo(old_context); --- 1602,1608 ---- corr_x2sum; /* Must copy the target values into anl_context */ ! old_context = MemoryContextSwitchTo(stats->anl_context); corrs = (float4 *) palloc(sizeof(float4)); MemoryContextSwitchTo(old_context); *************** *** 1607,1613 **** (values_cnt * corr_x2sum - corr_xsum * corr_xsum); stats->stakind[slot_idx] = STATISTIC_KIND_CORRELATION; ! stats->staop[slot_idx] = stats->ltopr; stats->stanumbers[slot_idx] = corrs; stats->numnumbers[slot_idx] = 1; slot_idx++; --- 1625,1631 ---- (values_cnt * corr_x2sum - corr_xsum * corr_xsum); stats->stakind[slot_idx] = STATISTIC_KIND_CORRELATION; ! stats->staop[slot_idx] = ltopr; stats->stanumbers[slot_idx] = corrs; stats->numnumbers[slot_idx] = 1; slot_idx++; diff -rc src/backend/commands/typecmds.c /home/pg74/pg_cvs/pgsql/src/backend/commands/typecmds.c *** src/backend/commands/typecmds.c Fri Jan 23 15:45:54 2004 --- /home/pg74/pg_cvs/pgsql/src/backend/commands/typecmds.c Fri Jan 23 15:07:56 2004 *************** *** 77,82 **** --- 77,83 ---- static Oid findTypeOutputFunction(List *procname, Oid typeOid); static Oid findTypeReceiveFunction(List *procname, Oid typeOid); static Oid findTypeSendFunction(List *procname, Oid typeOid); + static Oid findTypeAnalyzeFunction(List *procname, Oid typeOid); static List *get_rels_with_domain(Oid domainOid, LOCKMODE lockmode); static void domainOwnerCheck(HeapTuple tup, TypeName *typename); static char *domainAddConstraint(Oid domainOid, Oid domainNamespace, *************** *** 101,106 **** --- 102,108 ---- List *outputName = NIL; List *receiveName = NIL; List *sendName = NIL; + List *analyzeName = NIL; char *defaultValue = NULL; bool byValue = false; char delimiter = DEFAULT_TYPDELIM; *************** *** 110,120 **** --- 112,126 ---- Oid outputOid; Oid receiveOid = InvalidOid; Oid sendOid = InvalidOid; + Oid analyzeOid = F_PG_ANALYZE_ALG_DEFAULT; char *shadow_type; List *pl; Oid typoid; Oid resulttype; + + + /* Convert list of names to a name and namespace */ typeNamespace = QualifiedNameGetCreationNamespace(names, &typeName); *************** *** 151,156 **** --- 157,164 ---- receiveName = defGetQualifiedName(defel); else if (strcasecmp(defel->defname, "send") == 0) sendName = defGetQualifiedName(defel); + else if (strcasecmp(defel->defname, "analyze") == 0) + analyzeName = defGetQualifiedName(defel); else if (strcasecmp(defel->defname, "delimiter") == 0) { char *p = defGetString(defel); *************** *** 250,255 **** --- 258,264 ---- /* Make new shell type visible for modification below */ CommandCounterIncrement(); } + /* * Convert I/O proc names to OIDs *************** *** 260,265 **** --- 269,283 ---- receiveOid = findTypeReceiveFunction(receiveName, typoid); if (sendName) sendOid = findTypeSendFunction(sendName, typoid); + + /* + * Convert analyze proc name to OID. If none is specified then use the default + * F_PG_ANALYZE_ALG_DEFAULT instead + */ + if (analyzeName) + analyzeOid = findTypeAnalyzeFunction(analyzeName, typoid); + else + analyzeOid = F_PG_ANALYZE_ALG_DEFAULT; /* * Verify that I/O procs return the expected thing. If we see OPAQUE, *************** *** 317,324 **** errmsg("type send function %s must return type \"bytea\"", NameListToString(sendName)))); } ! /* * now have TypeCreate do all the real work. */ typoid = --- 335,352 ---- errmsg("type send function %s must return type \"bytea\"", NameListToString(sendName)))); } + if (analyzeOid) + { + resulttype = get_func_rettype(analyzeOid); + if (resulttype != BOOLOID) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("type analyze function %s must return type \"bool\"", + NameListToString(analyzeName)))); + } ! ! /* * now have TypeCreate do all the real work. */ typoid = *************** *** 334,339 **** --- 362,368 ---- outputOid, /* output procedure */ receiveOid, /* receive procedure */ sendOid, /* send procedure */ + analyzeOid, /* analyze procedure */ elemType, /* element type ID */ InvalidOid, /* base type ID (only for domains) */ defaultValue, /* default type value */ *************** *** 366,371 **** --- 395,401 ---- F_ARRAY_OUT, /* output procedure */ F_ARRAY_RECV, /* receive procedure */ F_ARRAY_SEND, /* send procedure */ + F_PG_ANALYZE_ALG_DEFAULT, /* analyze procedure */ typoid, /* element type ID */ InvalidOid, /* base type ID */ NULL, /* never a default type value */ *************** *** 473,478 **** --- 503,509 ---- Oid outputProcedure; Oid receiveProcedure; Oid sendProcedure; + Oid analyzeProcedure; bool byValue; char delimiter; char alignment; *************** *** 562,567 **** --- 593,601 ---- receiveProcedure = baseType->typreceive; sendProcedure = baseType->typsend; + /* Analyze function */ + analyzeProcedure = baseType->typanalyze; + /* Inherited default value */ datum = SysCacheGetAttr(TYPEOID, typeTup, Anum_pg_type_typdefault, &isnull); *************** *** 714,719 **** --- 748,754 ---- outputProcedure, /* output procedure */ receiveProcedure, /* receive procedure */ sendProcedure, /* send procedure */ + analyzeProcedure, /* analyze procedure */ basetypelem, /* element type ID */ basetypeoid, /* base type ID */ defaultValue, /* default type value (text) */ *************** *** 1034,1039 **** --- 1069,1102 ---- } + static Oid + findTypeAnalyzeFunction(List *procname, Oid typeOid) + { + Oid argList[FUNC_MAX_ARGS]; + Oid procOid; + + /* + * Send functions can take a single argument of the type, or two + * arguments (data value, element OID). + */ + MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid)); + + argList[0] = INTERNALOID; + + procOid = LookupFuncName(procname, 1, argList, true); + if (OidIsValid(procOid)) + return procOid; + + ereport(ERROR, + (errcode(ERRCODE_UNDEFINED_FUNCTION), + errmsg("function %s does not exist", + func_signature_string(procname, 1, argList)))); + + + return InvalidOid; /* keep compiler quiet */ + } + + /*------------------------------------------------------------------- * DefineCompositeType * *************** *** 1192,1197 **** --- 1255,1261 ---- typTup->typoutput, typTup->typreceive, typTup->typsend, + typTup->typanalyze, typTup->typelem, typTup->typbasetype, defaultExpr, diff -rc src/include/catalog/pg_attribute.h /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_attribute.h *** src/include/catalog/pg_attribute.h Fri Jan 23 15:45:55 2004 --- /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_attribute.h Tue Jan 20 23:19:44 2004 *************** *** 240,253 **** { 1247, {"typoutput"}, 24, -1, 4, 12, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ { 1247, {"typreceive"}, 24, -1, 4, 13, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ { 1247, {"typsend"}, 24, -1, 4, 14, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typalign"}, 18, -1, 1, 15, 0, -1, -1, true, 'p', false, 'c', true, false, false, true, 0 }, \ ! { 1247, {"typstorage"}, 18, -1, 1, 16, 0, -1, -1, true, 'p', false, 'c', true, false, false, true, 0 }, \ ! { 1247, {"typnotnull"}, 16, -1, 1, 17, 0, -1, -1, true, 'p', false, 'c', true, false, false, true, 0 }, \ ! { 1247, {"typbasetype"}, 26, -1, 4, 18, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typtypmod"}, 23, -1, 4, 19, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typndims"}, 23, -1, 4, 20, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typdefaultbin"}, 25, -1, -1, 21, 0, -1, -1, false, 'x', false, 'i', false, false, false, true, 0 }, \ ! { 1247, {"typdefault"}, 25, -1, -1, 22, 0, -1, -1, false, 'x', false, 'i', false, false, false, true, 0 } DATA(insert ( 1247 typname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f t 0)); --- 240,254 ---- { 1247, {"typoutput"}, 24, -1, 4, 12, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ { 1247, {"typreceive"}, 24, -1, 4, 13, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ { 1247, {"typsend"}, 24, -1, 4, 14, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typanalyze"}, 24, -1, 4, 15, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typalign"}, 18, -1, 1, 16, 0, -1, -1, true, 'p', false, 'c', true, false, false, true, 0 }, \ ! { 1247, {"typstorage"}, 18, -1, 1, 17, 0, -1, -1, true, 'p', false, 'c', true, false, false, true, 0 }, \ ! { 1247, {"typnotnull"}, 16, -1, 1, 18, 0, -1, -1, true, 'p', false, 'c', true, false, false, true, 0 }, \ ! { 1247, {"typbasetype"}, 26, -1, 4, 19, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typtypmod"}, 23, -1, 4, 20, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typndims"}, 23, -1, 4, 21, 0, -1, -1, true, 'p', false, 'i', true, false, false, true, 0 }, \ ! { 1247, {"typdefaultbin"}, 25, -1, -1, 22, 0, -1, -1, false, 'x', false, 'i', false, false, false, true, 0 }, \ ! { 1247, {"typdefault"}, 25, -1, -1, 23, 0, -1, -1, false, 'x', false, 'i', false, false, false, true, 0 } DATA(insert ( 1247 typname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f t 0)); *************** *** 264,277 **** DATA(insert ( 1247 typoutput 24 -1 4 12 0 -1 -1 t p f i t f f t 0)); DATA(insert ( 1247 typreceive 24 -1 4 13 0 -1 -1 t p f i t f f t 0)); DATA(insert ( 1247 typsend 24 -1 4 14 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typalign 18 -1 1 15 0 -1 -1 t p f c t f f t 0)); ! DATA(insert ( 1247 typstorage 18 -1 1 16 0 -1 -1 t p f c t f f t 0)); ! DATA(insert ( 1247 typnotnull 16 -1 1 17 0 -1 -1 t p f c t f f t 0)); ! DATA(insert ( 1247 typbasetype 26 -1 4 18 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typtypmod 23 -1 4 19 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typndims 23 -1 4 20 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typdefaultbin 25 -1 -1 21 0 -1 -1 f x f i f f f t 0)); ! DATA(insert ( 1247 typdefault 25 -1 -1 22 0 -1 -1 f x f i f f f t 0)); DATA(insert ( 1247 ctid 27 0 6 -1 0 -1 -1 f p f i t f f t 0)); DATA(insert ( 1247 oid 26 0 4 -2 0 -1 -1 t p f i t f f t 0)); DATA(insert ( 1247 xmin 28 0 4 -3 0 -1 -1 t p f i t f f t 0)); --- 265,279 ---- DATA(insert ( 1247 typoutput 24 -1 4 12 0 -1 -1 t p f i t f f t 0)); DATA(insert ( 1247 typreceive 24 -1 4 13 0 -1 -1 t p f i t f f t 0)); DATA(insert ( 1247 typsend 24 -1 4 14 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typanalyze 24 -1 4 15 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typalign 18 -1 1 16 0 -1 -1 t p f c t f f t 0)); ! DATA(insert ( 1247 typstorage 18 -1 1 17 0 -1 -1 t p f c t f f t 0)); ! DATA(insert ( 1247 typnotnull 16 -1 1 18 0 -1 -1 t p f c t f f t 0)); ! DATA(insert ( 1247 typbasetype 26 -1 4 19 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typtypmod 23 -1 4 20 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typndims 23 -1 4 21 0 -1 -1 t p f i t f f t 0)); ! DATA(insert ( 1247 typdefaultbin 25 -1 -1 22 0 -1 -1 f x f i f f f t 0)); ! DATA(insert ( 1247 typdefault 25 -1 -1 23 0 -1 -1 f x f i f f f t 0)); DATA(insert ( 1247 ctid 27 0 6 -1 0 -1 -1 f p f i t f f t 0)); DATA(insert ( 1247 oid 26 0 4 -2 0 -1 -1 t p f i t f f t 0)); DATA(insert ( 1247 xmin 28 0 4 -3 0 -1 -1 t p f i t f f t 0)); Only in /home/pg74/pg_cvs/pgsql/src/include/catalog: pg_attribute.h.orig diff -rc src/include/catalog/pg_class.h /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_class.h *** src/include/catalog/pg_class.h Fri Jan 23 15:45:55 2004 --- /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_class.h Wed Jan 21 21:40:11 2004 *************** *** 134,140 **** * ---------------- */ ! DATA(insert OID = 1247 ( pg_type PGNSP 71 PGUID 0 1247 0 0 0 0 f f r 22 0 0 0 0 0 t f f f _null_ )); DESCR(""); DATA(insert OID = 1249 ( pg_attribute PGNSP 75 PGUID 0 1249 0 0 0 0 f f r 18 0 0 0 0 0 f f f f _null_ )); DESCR(""); --- 134,140 ---- * ---------------- */ ! DATA(insert OID = 1247 ( pg_type PGNSP 71 PGUID 0 1247 0 0 0 0 f f r 23 0 0 0 0 0 t f f f _null_ )); DESCR(""); DATA(insert OID = 1249 ( pg_attribute PGNSP 75 PGUID 0 1249 0 0 0 0 f f r 18 0 0 0 0 0 f f f f _null_ )); DESCR(""); diff -rc src/include/catalog/pg_proc.h /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_proc.h *** src/include/catalog/pg_proc.h Fri Jan 23 15:45:55 2004 --- /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_proc.h Tue Jan 20 22:39:00 2004 *************** *** 3424,3429 **** --- 3424,3433 ---- DATA(insert OID = 2509 ( pg_get_expr PGNSP PGUID 12 f f t f s 3 25 "25 26 16" _null_ pg_get_expr_ext - _null_ )); DESCR("deparse an encoded expression with pretty-print option"); + /* Default analyze function for table columns */ + DATA(insert OID = 2510 ( pg_analyze_alg_default PGNSP PGUID 12 f f t f i 2 16 "2281 2281" _null_ pg_analyze_alg_default - _null_ )); + DESCR("default analyze algorithm for in-built datatypes"); + /* * Symbolic values for provolatile column: these indicate whether the result diff -rc src/include/catalog/pg_statistic.h /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_statistic.h *** src/include/catalog/pg_statistic.h Fri Jan 23 15:45:55 2004 --- /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_statistic.h Fri Jan 23 09:28:05 2004 *************** *** 212,215 **** --- 212,222 ---- */ #define STATISTIC_KIND_CORRELATION 3 + /* + * A custom function that has been provided by the user and is therefore + * its contents are datatype specific + */ + #define STATISTIC_KIND_CUSTOM 20 + + #endif /* PG_STATISTIC_H */ diff -rc src/include/catalog/pg_type.h /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_type.h *** src/include/catalog/pg_type.h Fri Jan 23 15:45:55 2004 --- /home/pg74/pg_cvs/pgsql/src/include/catalog/pg_type.h Thu Jan 22 13:08:17 2004 *************** *** 104,109 **** --- 104,114 ---- regproc typreceive; /* binary format (optional) */ regproc typsend; + /* + * Analyze function for the datatype. + */ + regproc typanalyze; + /* ---------------- * typalign is the alignment required when storing a value of this * type. It applies to storage on disk as well as most *************** *** 200,206 **** * compiler constants for pg_type * ---------------- */ ! #define Natts_pg_type 22 #define Anum_pg_type_typname 1 #define Anum_pg_type_typnamespace 2 #define Anum_pg_type_typowner 3 --- 205,211 ---- * compiler constants for pg_type * ---------------- */ ! #define Natts_pg_type 23 #define Anum_pg_type_typname 1 #define Anum_pg_type_typnamespace 2 #define Anum_pg_type_typowner 3 *************** *** 215,228 **** #define Anum_pg_type_typoutput 12 #define Anum_pg_type_typreceive 13 #define Anum_pg_type_typsend 14 ! #define Anum_pg_type_typalign 15 ! #define Anum_pg_type_typstorage 16 ! #define Anum_pg_type_typnotnull 17 ! #define Anum_pg_type_typbasetype 18 ! #define Anum_pg_type_typtypmod 19 ! #define Anum_pg_type_typndims 20 ! #define Anum_pg_type_typdefaultbin 21 ! #define Anum_pg_type_typdefault 22 /* ---------------- --- 220,234 ---- #define Anum_pg_type_typoutput 12 #define Anum_pg_type_typreceive 13 #define Anum_pg_type_typsend 14 ! #define Anum_pg_type_typanalyze 15 ! #define Anum_pg_type_typalign 16 ! #define Anum_pg_type_typstorage 17 ! #define Anum_pg_type_typnotnull 18 ! #define Anum_pg_type_typbasetype 19 ! #define Anum_pg_type_typtypmod 20 ! #define Anum_pg_type_typndims 21 ! #define Anum_pg_type_typdefaultbin 22 ! #define Anum_pg_type_typdefault 23 /* ---------------- *************** *** 238,319 **** */ /* OIDS 1 - 99 */ ! DATA(insert OID = 16 ( bool PGNSP PGUID 1 t b t \054 0 0 boolin boolout boolrecv boolsend c p f 0 -1 0 _null_ _null_ )); DESCR("boolean, 'true'/'false'"); #define BOOLOID 16 ! DATA(insert OID = 17 ( bytea PGNSP PGUID -1 f b t \054 0 0 byteain byteaout bytearecv byteasend i x f 0 -1 0 _null_ _null_ )); DESCR("variable-length string, binary values escaped"); #define BYTEAOID 17 ! DATA(insert OID = 18 ( char PGNSP PGUID 1 t b t \054 0 0 charin charout charrecv charsend c p f 0 -1 0 _null_ _null_ )); DESCR("single character"); #define CHAROID 18 ! DATA(insert OID = 19 ( name PGNSP PGUID NAMEDATALEN f b t \054 0 18 namein nameout namerecv namesend i p f 0 -1 0 _null_ _null_ )); DESCR("63-character type for storing system identifiers"); #define NAMEOID 19 ! DATA(insert OID = 20 ( int8 PGNSP PGUID 8 f b t \054 0 0 int8in int8out int8recv int8send d p f 0 -1 0 _null_ _null_ )); DESCR("~18 digit integer, 8-byte storage"); #define INT8OID 20 ! DATA(insert OID = 21 ( int2 PGNSP PGUID 2 t b t \054 0 0 int2in int2out int2recv int2send s p f 0 -1 0 _null_ _null_ )); DESCR("-32 thousand to 32 thousand, 2-byte storage"); #define INT2OID 21 ! DATA(insert OID = 22 ( int2vector PGNSP PGUID INDEX_MAX_KEYS*2 f b t \054 0 21 int2vectorin int2vectorout int2vectorrecv int2vectorsend i p f 0 -1 0 _null_ _null_ )); DESCR("array of INDEX_MAX_KEYS int2 integers, used in system tables"); #define INT2VECTOROID 22 ! DATA(insert OID = 23 ( int4 PGNSP PGUID 4 t b t \054 0 0 int4in int4out int4recv int4send i p f 0 -1 0 _null_ _null_ )); DESCR("-2 billion to 2 billion integer, 4-byte storage"); #define INT4OID 23 ! DATA(insert OID = 24 ( regproc PGNSP PGUID 4 t b t \054 0 0 regprocin regprocout regprocrecv regprocsend i p f 0 -1 0 _null_ _null_ )); DESCR("registered procedure"); #define REGPROCOID 24 ! DATA(insert OID = 25 ( text PGNSP PGUID -1 f b t \054 0 0 textin textout textrecv textsend i x f 0 -1 0 _null_ _null_ )); DESCR("variable-length string, no limit specified"); #define TEXTOID 25 ! DATA(insert OID = 26 ( oid PGNSP PGUID 4 t b t \054 0 0 oidin oidout oidrecv oidsend i p f 0 -1 0 _null_ _null_ )); DESCR("object identifier(oid), maximum 4 billion"); #define OIDOID 26 ! DATA(insert OID = 27 ( tid PGNSP PGUID 6 f b t \054 0 0 tidin tidout tidrecv tidsend i p f 0 -1 0 _null_ _null_ )); DESCR("(Block, offset), physical location of tuple"); #define TIDOID 27 ! DATA(insert OID = 28 ( xid PGNSP PGUID 4 t b t \054 0 0 xidin xidout xidrecv xidsend i p f 0 -1 0 _null_ _null_ )); DESCR("transaction id"); #define XIDOID 28 ! DATA(insert OID = 29 ( cid PGNSP PGUID 4 t b t \054 0 0 cidin cidout cidrecv cidsend i p f 0 -1 0 _null_ _null_ )); DESCR("command identifier type, sequence in transaction id"); #define CIDOID 29 ! DATA(insert OID = 30 ( oidvector PGNSP PGUID INDEX_MAX_KEYS*4 f b t \054 0 26 oidvectorin oidvectorout oidvectorrecv oidvectorsend i p f 0 -1 0 _null_ _null_ )); DESCR("array of INDEX_MAX_KEYS oids, used in system tables"); #define OIDVECTOROID 30 ! DATA(insert OID = 32 ( SET PGNSP PGUID -1 f b t \054 0 0 unknownin unknownout - - i p f 0 -1 0 _null_ _null_ )); DESCR("set of tuples"); ! DATA(insert OID = 71 ( pg_type PGNSP PGUID 4 t c t \054 1247 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 75 ( pg_attribute PGNSP PGUID 4 t c t \054 1249 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 81 ( pg_proc PGNSP PGUID 4 t c t \054 1255 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 83 ( pg_class PGNSP PGUID 4 t c t \054 1259 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 86 ( pg_shadow PGNSP PGUID 4 t c t \054 1260 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 87 ( pg_group PGNSP PGUID 4 t c t \054 1261 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 88 ( pg_database PGNSP PGUID 4 t c t \054 1262 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); /* OIDS 100 - 199 */ /* OIDS 200 - 299 */ ! DATA(insert OID = 210 ( smgr PGNSP PGUID 2 t b t \054 0 0 smgrin smgrout - - s p f 0 -1 0 _null_ _null_ )); DESCR("storage manager"); /* OIDS 300 - 399 */ --- 244,325 ---- */ /* OIDS 1 - 99 */ ! DATA(insert OID = 16 ( bool PGNSP PGUID 1 t b t \054 0 0 boolin boolout boolrecv boolsend pg_analyze_alg_default c p f 0 -1 0 _null_ _null_ )); DESCR("boolean, 'true'/'false'"); #define BOOLOID 16 ! DATA(insert OID = 17 ( bytea PGNSP PGUID -1 f b t \054 0 0 byteain byteaout bytearecv byteasend pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); DESCR("variable-length string, binary values escaped"); #define BYTEAOID 17 ! DATA(insert OID = 18 ( char PGNSP PGUID 1 t b t \054 0 0 charin charout charrecv charsend pg_analyze_alg_default c p f 0 -1 0 _null_ _null_ )); DESCR("single character"); #define CHAROID 18 ! DATA(insert OID = 19 ( name PGNSP PGUID NAMEDATALEN f b t \054 0 18 namein nameout namerecv namesend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("63-character type for storing system identifiers"); #define NAMEOID 19 ! DATA(insert OID = 20 ( int8 PGNSP PGUID 8 f b t \054 0 0 int8in int8out int8recv int8send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("~18 digit integer, 8-byte storage"); #define INT8OID 20 ! DATA(insert OID = 21 ( int2 PGNSP PGUID 2 t b t \054 0 0 int2in int2out int2recv int2send pg_analyze_alg_default s p f 0 -1 0 _null_ _null_ )); DESCR("-32 thousand to 32 thousand, 2-byte storage"); #define INT2OID 21 ! DATA(insert OID = 22 ( int2vector PGNSP PGUID INDEX_MAX_KEYS*2 f b t \054 0 21 int2vectorin int2vectorout int2vectorrecv int2vectorsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("array of INDEX_MAX_KEYS int2 integers, used in system tables"); #define INT2VECTOROID 22 ! DATA(insert OID = 23 ( int4 PGNSP PGUID 4 t b t \054 0 0 int4in int4out int4recv int4send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("-2 billion to 2 billion integer, 4-byte storage"); #define INT4OID 23 ! DATA(insert OID = 24 ( regproc PGNSP PGUID 4 t b t \054 0 0 regprocin regprocout regprocrecv regprocsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("registered procedure"); #define REGPROCOID 24 ! DATA(insert OID = 25 ( text PGNSP PGUID -1 f b t \054 0 0 textin textout textrecv textsend pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); DESCR("variable-length string, no limit specified"); #define TEXTOID 25 ! DATA(insert OID = 26 ( oid PGNSP PGUID 4 t b t \054 0 0 oidin oidout oidrecv oidsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("object identifier(oid), maximum 4 billion"); #define OIDOID 26 ! DATA(insert OID = 27 ( tid PGNSP PGUID 6 f b t \054 0 0 tidin tidout tidrecv tidsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("(Block, offset), physical location of tuple"); #define TIDOID 27 ! DATA(insert OID = 28 ( xid PGNSP PGUID 4 t b t \054 0 0 xidin xidout xidrecv xidsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("transaction id"); #define XIDOID 28 ! DATA(insert OID = 29 ( cid PGNSP PGUID 4 t b t \054 0 0 cidin cidout cidrecv cidsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("command identifier type, sequence in transaction id"); #define CIDOID 29 ! DATA(insert OID = 30 ( oidvector PGNSP PGUID INDEX_MAX_KEYS*4 f b t \054 0 26 oidvectorin oidvectorout oidvectorrecv oidvectorsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("array of INDEX_MAX_KEYS oids, used in system tables"); #define OIDVECTOROID 30 ! DATA(insert OID = 32 ( SET PGNSP PGUID -1 f b t \054 0 0 unknownin unknownout - - pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("set of tuples"); ! DATA(insert OID = 71 ( pg_type PGNSP PGUID 4 t c t \054 1247 0 record_in record_out record_recv record_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 75 ( pg_attribute PGNSP PGUID 4 t c t \054 1249 0 record_in record_out record_recv record_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 81 ( pg_proc PGNSP PGUID 4 t c t \054 1255 0 record_in record_out record_recv record_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 83 ( pg_class PGNSP PGUID 4 t c t \054 1259 0 record_in record_out record_recv record_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 86 ( pg_shadow PGNSP PGUID 4 t c t \054 1260 0 record_in record_out record_recv record_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 87 ( pg_group PGNSP PGUID 4 t c t \054 1261 0 record_in record_out record_recv record_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 88 ( pg_database PGNSP PGUID 4 t c t \054 1262 0 record_in record_out record_recv record_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); /* OIDS 100 - 199 */ /* OIDS 200 - 299 */ ! DATA(insert OID = 210 ( smgr PGNSP PGUID 2 t b t \054 0 0 smgrin smgrout - - pg_analyze_alg_default s p f 0 -1 0 _null_ _null_ )); DESCR("storage manager"); /* OIDS 300 - 399 */ *************** *** 323,514 **** /* OIDS 500 - 599 */ /* OIDS 600 - 699 */ ! DATA(insert OID = 600 ( point PGNSP PGUID 16 f b t \054 0 701 point_in point_out point_recv point_send d p f 0 -1 0 _null_ _null_ )); DESCR("geometric point '(x, y)'"); #define POINTOID 600 ! DATA(insert OID = 601 ( lseg PGNSP PGUID 32 f b t \054 0 600 lseg_in lseg_out lseg_recv lseg_send d p f 0 -1 0 _null_ _null_ )); DESCR("geometric line segment '(pt1,pt2)'"); #define LSEGOID 601 ! DATA(insert OID = 602 ( path PGNSP PGUID -1 f b t \054 0 0 path_in path_out path_recv path_send d x f 0 -1 0 _null_ _null_ )); DESCR("geometric path '(pt1,...)'"); #define PATHOID 602 ! DATA(insert OID = 603 ( box PGNSP PGUID 32 f b t \073 0 600 box_in box_out box_recv box_send d p f 0 -1 0 _null_ _null_ )); DESCR("geometric box '(lower left,upper right)'"); #define BOXOID 603 ! DATA(insert OID = 604 ( polygon PGNSP PGUID -1 f b t \054 0 0 poly_in poly_out poly_recv poly_send d x f 0 -1 0 _null_ _null_ )); DESCR("geometric polygon '(pt1,...)'"); #define POLYGONOID 604 ! DATA(insert OID = 628 ( line PGNSP PGUID 32 f b t \054 0 701 line_in line_out line_recv line_send d p f 0 -1 0 _null_ _null_ )); DESCR("geometric line (not implemented)'"); #define LINEOID 628 ! DATA(insert OID = 629 ( _line PGNSP PGUID -1 f b t \054 0 628 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); DESCR(""); /* OIDS 700 - 799 */ ! DATA(insert OID = 700 ( float4 PGNSP PGUID 4 f b t \054 0 0 float4in float4out float4recv float4send i p f 0 -1 0 _null_ _null_ )); DESCR("single-precision floating point number, 4-byte storage"); #define FLOAT4OID 700 ! DATA(insert OID = 701 ( float8 PGNSP PGUID 8 f b t \054 0 0 float8in float8out float8recv float8send d p f 0 -1 0 _null_ _null_ )); DESCR("double-precision floating point number, 8-byte storage"); #define FLOAT8OID 701 ! DATA(insert OID = 702 ( abstime PGNSP PGUID 4 t b t \054 0 0 abstimein abstimeout abstimerecv abstimesend i p f 0 -1 0 _null_ _null_ )); DESCR("absolute, limited-range date and time (Unix system time)"); #define ABSTIMEOID 702 ! DATA(insert OID = 703 ( reltime PGNSP PGUID 4 t b t \054 0 0 reltimein reltimeout reltimerecv reltimesend i p f 0 -1 0 _null_ _null_ )); DESCR("relative, limited-range time interval (Unix delta time)"); #define RELTIMEOID 703 ! DATA(insert OID = 704 ( tinterval PGNSP PGUID 12 f b t \054 0 0 tintervalin tintervalout tintervalrecv tintervalsend i p f 0 -1 0 _null_ _null_ )); DESCR("(abstime,abstime), time interval"); #define TINTERVALOID 704 ! DATA(insert OID = 705 ( unknown PGNSP PGUID -1 f b t \054 0 0 unknownin unknownout unknownrecv unknownsend i p f 0 -1 0 _null_ _null_ )); DESCR(""); #define UNKNOWNOID 705 ! DATA(insert OID = 718 ( circle PGNSP PGUID 24 f b t \054 0 0 circle_in circle_out circle_recv circle_send d p f 0 -1 0 _null_ _null_ )); DESCR("geometric circle '(center,radius)'"); #define CIRCLEOID 718 ! DATA(insert OID = 719 ( _circle PGNSP PGUID -1 f b t \054 0 718 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 790 ( money PGNSP PGUID 4 f b t \054 0 0 cash_in cash_out cash_recv cash_send i p f 0 -1 0 _null_ _null_ )); DESCR("monetary amounts, $d,ddd.cc"); #define CASHOID 790 ! DATA(insert OID = 791 ( _money PGNSP PGUID -1 f b t \054 0 790 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); /* OIDS 800 - 899 */ ! DATA(insert OID = 829 ( macaddr PGNSP PGUID 6 f b t \054 0 0 macaddr_in macaddr_out macaddr_recv macaddr_send i p f 0 -1 0 _null_ _null_ )); DESCR("XX:XX:XX:XX:XX:XX, MAC address"); #define MACADDROID 829 ! DATA(insert OID = 869 ( inet PGNSP PGUID -1 f b t \054 0 0 inet_in inet_out inet_recv inet_send i p f 0 -1 0 _null_ _null_ )); DESCR("IP address/netmask, host address, netmask optional"); #define INETOID 869 ! DATA(insert OID = 650 ( cidr PGNSP PGUID -1 f b t \054 0 0 cidr_in cidr_out cidr_recv cidr_send i p f 0 -1 0 _null_ _null_ )); DESCR("network IP address/netmask, network address"); #define CIDROID 650 /* OIDS 900 - 999 */ /* OIDS 1000 - 1099 */ ! DATA(insert OID = 1000 ( _bool PGNSP PGUID -1 f b t \054 0 16 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1001 ( _bytea PGNSP PGUID -1 f b t \054 0 17 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1002 ( _char PGNSP PGUID -1 f b t \054 0 18 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1003 ( _name PGNSP PGUID -1 f b t \054 0 19 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1005 ( _int2 PGNSP PGUID -1 f b t \054 0 21 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1006 ( _int2vector PGNSP PGUID -1 f b t \054 0 22 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1007 ( _int4 PGNSP PGUID -1 f b t \054 0 23 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1008 ( _regproc PGNSP PGUID -1 f b t \054 0 24 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1009 ( _text PGNSP PGUID -1 f b t \054 0 25 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1028 ( _oid PGNSP PGUID -1 f b t \054 0 26 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1010 ( _tid PGNSP PGUID -1 f b t \054 0 27 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1011 ( _xid PGNSP PGUID -1 f b t \054 0 28 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1012 ( _cid PGNSP PGUID -1 f b t \054 0 29 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1013 ( _oidvector PGNSP PGUID -1 f b t \054 0 30 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1014 ( _bpchar PGNSP PGUID -1 f b t \054 0 1042 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1015 ( _varchar PGNSP PGUID -1 f b t \054 0 1043 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1016 ( _int8 PGNSP PGUID -1 f b t \054 0 20 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1017 ( _point PGNSP PGUID -1 f b t \054 0 600 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1018 ( _lseg PGNSP PGUID -1 f b t \054 0 601 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1019 ( _path PGNSP PGUID -1 f b t \054 0 602 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1020 ( _box PGNSP PGUID -1 f b t \073 0 603 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1021 ( _float4 PGNSP PGUID -1 f b t \054 0 700 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1022 ( _float8 PGNSP PGUID -1 f b t \054 0 701 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1023 ( _abstime PGNSP PGUID -1 f b t \054 0 702 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1024 ( _reltime PGNSP PGUID -1 f b t \054 0 703 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1025 ( _tinterval PGNSP PGUID -1 f b t \054 0 704 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1027 ( _polygon PGNSP PGUID -1 f b t \054 0 604 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1033 ( aclitem PGNSP PGUID 12 f b t \054 0 0 aclitemin aclitemout - - i p f 0 -1 0 _null_ _null_ )); DESCR("access control list"); #define ACLITEMOID 1033 ! DATA(insert OID = 1034 ( _aclitem PGNSP PGUID -1 f b t \054 0 1033 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1040 ( _macaddr PGNSP PGUID -1 f b t \054 0 829 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1041 ( _inet PGNSP PGUID -1 f b t \054 0 869 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 651 ( _cidr PGNSP PGUID -1 f b t \054 0 650 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1042 ( bpchar PGNSP PGUID -1 f b t \054 0 0 bpcharin bpcharout bpcharrecv bpcharsend i x f 0 -1 0 _null_ _null_ )); DESCR("char(length), blank-padded string, fixed storage length"); #define BPCHAROID 1042 ! DATA(insert OID = 1043 ( varchar PGNSP PGUID -1 f b t \054 0 0 varcharin varcharout varcharrecv varcharsend i x f 0 -1 0 _null_ _null_ )); DESCR("varchar(length), non-blank-padded string, variable storage length"); #define VARCHAROID 1043 ! DATA(insert OID = 1082 ( date PGNSP PGUID 4 t b t \054 0 0 date_in date_out date_recv date_send i p f 0 -1 0 _null_ _null_ )); DESCR("ANSI SQL date"); #define DATEOID 1082 ! DATA(insert OID = 1083 ( time PGNSP PGUID 8 f b t \054 0 0 time_in time_out time_recv time_send d p f 0 -1 0 _null_ _null_ )); DESCR("hh:mm:ss, ANSI SQL time"); #define TIMEOID 1083 /* OIDS 1100 - 1199 */ ! DATA(insert OID = 1114 ( timestamp PGNSP PGUID 8 f b t \054 0 0 timestamp_in timestamp_out timestamp_recv timestamp_send d p f 0 -1 0 _null_ _null_ )); DESCR("date and time"); #define TIMESTAMPOID 1114 ! DATA(insert OID = 1115 ( _timestamp PGNSP PGUID -1 f b t \054 0 1114 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1182 ( _date PGNSP PGUID -1 f b t \054 0 1082 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1183 ( _time PGNSP PGUID -1 f b t \054 0 1083 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1184 ( timestamptz PGNSP PGUID 8 f b t \054 0 0 timestamptz_in timestamptz_out timestamptz_recv timestamptz_send d p f 0 -1 0 _null_ _null_ )); DESCR("date and time with time zone"); #define TIMESTAMPTZOID 1184 ! DATA(insert OID = 1185 ( _timestamptz PGNSP PGUID -1 f b t \054 0 1184 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1186 ( interval PGNSP PGUID 12 f b t \054 0 0 interval_in interval_out interval_recv interval_send d p f 0 -1 0 _null_ _null_ )); DESCR("@ , time interval"); #define INTERVALOID 1186 ! DATA(insert OID = 1187 ( _interval PGNSP PGUID -1 f b t \054 0 1186 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); /* OIDS 1200 - 1299 */ ! DATA(insert OID = 1231 ( _numeric PGNSP PGUID -1 f b t \054 0 1700 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1266 ( timetz PGNSP PGUID 12 f b t \054 0 0 timetz_in timetz_out timetz_recv timetz_send d p f 0 -1 0 _null_ _null_ )); DESCR("hh:mm:ss, ANSI SQL time"); #define TIMETZOID 1266 ! DATA(insert OID = 1270 ( _timetz PGNSP PGUID -1 f b t \054 0 1266 array_in array_out array_recv array_send d x f 0 -1 0 _null_ _null_ )); /* OIDS 1500 - 1599 */ ! DATA(insert OID = 1560 ( bit PGNSP PGUID -1 f b t \054 0 0 bit_in bit_out bit_recv bit_send i x f 0 -1 0 _null_ _null_ )); DESCR("fixed-length bit string"); #define BITOID 1560 ! DATA(insert OID = 1561 ( _bit PGNSP PGUID -1 f b t \054 0 1560 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1562 ( varbit PGNSP PGUID -1 f b t \054 0 0 varbit_in varbit_out varbit_recv varbit_send i x f 0 -1 0 _null_ _null_ )); DESCR("variable-length bit string"); #define VARBITOID 1562 ! DATA(insert OID = 1563 ( _varbit PGNSP PGUID -1 f b t \054 0 1562 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); /* OIDS 1600 - 1699 */ /* OIDS 1700 - 1799 */ ! DATA(insert OID = 1700 ( numeric PGNSP PGUID -1 f b t \054 0 0 numeric_in numeric_out numeric_recv numeric_send i m f 0 -1 0 _null_ _null_ )); DESCR("numeric(precision, decimal), arbitrary precision number"); #define NUMERICOID 1700 ! DATA(insert OID = 1790 ( refcursor PGNSP PGUID -1 f b t \054 0 0 textin textout textrecv textsend i x f 0 -1 0 _null_ _null_ )); DESCR("reference cursor (portal name)"); #define REFCURSOROID 1790 /* OIDS 2200 - 2299 */ ! DATA(insert OID = 2201 ( _refcursor PGNSP PGUID -1 f b t \054 0 1790 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2202 ( regprocedure PGNSP PGUID 4 t b t \054 0 0 regprocedurein regprocedureout regprocedurerecv regproceduresend i p f 0 -1 0 _null_ _null_ )); DESCR("registered procedure (with args)"); #define REGPROCEDUREOID 2202 ! DATA(insert OID = 2203 ( regoper PGNSP PGUID 4 t b t \054 0 0 regoperin regoperout regoperrecv regopersend i p f 0 -1 0 _null_ _null_ )); DESCR("registered operator"); #define REGOPEROID 2203 ! DATA(insert OID = 2204 ( regoperator PGNSP PGUID 4 t b t \054 0 0 regoperatorin regoperatorout regoperatorrecv regoperatorsend i p f 0 -1 0 _null_ _null_ )); DESCR("registered operator (with args)"); #define REGOPERATOROID 2204 ! DATA(insert OID = 2205 ( regclass PGNSP PGUID 4 t b t \054 0 0 regclassin regclassout regclassrecv regclasssend i p f 0 -1 0 _null_ _null_ )); DESCR("registered class"); #define REGCLASSOID 2205 ! DATA(insert OID = 2206 ( regtype PGNSP PGUID 4 t b t \054 0 0 regtypein regtypeout regtyperecv regtypesend i p f 0 -1 0 _null_ _null_ )); DESCR("registered type"); #define REGTYPEOID 2206 ! DATA(insert OID = 2207 ( _regprocedure PGNSP PGUID -1 f b t \054 0 2202 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2208 ( _regoper PGNSP PGUID -1 f b t \054 0 2203 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2209 ( _regoperator PGNSP PGUID -1 f b t \054 0 2204 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2210 ( _regclass PGNSP PGUID -1 f b t \054 0 2205 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b t \054 0 2206 array_in array_out array_recv array_send i x f 0 -1 0 _null_ _null_ )); /* * pseudo-types --- 329,520 ---- /* OIDS 500 - 599 */ /* OIDS 600 - 699 */ ! DATA(insert OID = 600 ( point PGNSP PGUID 16 f b t \054 0 701 point_in point_out point_recv point_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("geometric point '(x, y)'"); #define POINTOID 600 ! DATA(insert OID = 601 ( lseg PGNSP PGUID 32 f b t \054 0 600 lseg_in lseg_out lseg_recv lseg_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("geometric line segment '(pt1,pt2)'"); #define LSEGOID 601 ! DATA(insert OID = 602 ( path PGNSP PGUID -1 f b t \054 0 0 path_in path_out path_recv path_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); DESCR("geometric path '(pt1,...)'"); #define PATHOID 602 ! DATA(insert OID = 603 ( box PGNSP PGUID 32 f b t \073 0 600 box_in box_out box_recv box_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("geometric box '(lower left,upper right)'"); #define BOXOID 603 ! DATA(insert OID = 604 ( polygon PGNSP PGUID -1 f b t \054 0 0 poly_in poly_out poly_recv poly_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); DESCR("geometric polygon '(pt1,...)'"); #define POLYGONOID 604 ! DATA(insert OID = 628 ( line PGNSP PGUID 32 f b t \054 0 701 line_in line_out line_recv line_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("geometric line (not implemented)'"); #define LINEOID 628 ! DATA(insert OID = 629 ( _line PGNSP PGUID -1 f b t \054 0 628 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); DESCR(""); /* OIDS 700 - 799 */ ! DATA(insert OID = 700 ( float4 PGNSP PGUID 4 f b t \054 0 0 float4in float4out float4recv float4send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("single-precision floating point number, 4-byte storage"); #define FLOAT4OID 700 ! DATA(insert OID = 701 ( float8 PGNSP PGUID 8 f b t \054 0 0 float8in float8out float8recv float8send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("double-precision floating point number, 8-byte storage"); #define FLOAT8OID 701 ! DATA(insert OID = 702 ( abstime PGNSP PGUID 4 t b t \054 0 0 abstimein abstimeout abstimerecv abstimesend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("absolute, limited-range date and time (Unix system time)"); #define ABSTIMEOID 702 ! DATA(insert OID = 703 ( reltime PGNSP PGUID 4 t b t \054 0 0 reltimein reltimeout reltimerecv reltimesend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("relative, limited-range time interval (Unix delta time)"); #define RELTIMEOID 703 ! DATA(insert OID = 704 ( tinterval PGNSP PGUID 12 f b t \054 0 0 tintervalin tintervalout tintervalrecv tintervalsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("(abstime,abstime), time interval"); #define TINTERVALOID 704 ! DATA(insert OID = 705 ( unknown PGNSP PGUID -1 f b t \054 0 0 unknownin unknownout unknownrecv unknownsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR(""); #define UNKNOWNOID 705 ! DATA(insert OID = 718 ( circle PGNSP PGUID 24 f b t \054 0 0 circle_in circle_out circle_recv circle_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("geometric circle '(center,radius)'"); #define CIRCLEOID 718 ! DATA(insert OID = 719 ( _circle PGNSP PGUID -1 f b t \054 0 718 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 790 ( money PGNSP PGUID 4 f b t \054 0 0 cash_in cash_out cash_recv cash_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("monetary amounts, $d,ddd.cc"); #define CASHOID 790 ! DATA(insert OID = 791 ( _money PGNSP PGUID -1 f b t \054 0 790 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); /* OIDS 800 - 899 */ ! DATA(insert OID = 829 ( macaddr PGNSP PGUID 6 f b t \054 0 0 macaddr_in macaddr_out macaddr_recv macaddr_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("XX:XX:XX:XX:XX:XX, MAC address"); #define MACADDROID 829 ! DATA(insert OID = 869 ( inet PGNSP PGUID -1 f b t \054 0 0 inet_in inet_out inet_recv inet_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("IP address/netmask, host address, netmask optional"); #define INETOID 869 ! DATA(insert OID = 650 ( cidr PGNSP PGUID -1 f b t \054 0 0 cidr_in cidr_out cidr_recv cidr_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("network IP address/netmask, network address"); #define CIDROID 650 /* OIDS 900 - 999 */ /* OIDS 1000 - 1099 */ ! DATA(insert OID = 1000 ( _bool PGNSP PGUID -1 f b t \054 0 16 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1001 ( _bytea PGNSP PGUID -1 f b t \054 0 17 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1002 ( _char PGNSP PGUID -1 f b t \054 0 18 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1003 ( _name PGNSP PGUID -1 f b t \054 0 19 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1005 ( _int2 PGNSP PGUID -1 f b t \054 0 21 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1006 ( _int2vector PGNSP PGUID -1 f b t \054 0 22 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1007 ( _int4 PGNSP PGUID -1 f b t \054 0 23 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1008 ( _regproc PGNSP PGUID -1 f b t \054 0 24 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1009 ( _text PGNSP PGUID -1 f b t \054 0 25 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1028 ( _oid PGNSP PGUID -1 f b t \054 0 26 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1010 ( _tid PGNSP PGUID -1 f b t \054 0 27 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1011 ( _xid PGNSP PGUID -1 f b t \054 0 28 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1012 ( _cid PGNSP PGUID -1 f b t \054 0 29 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1013 ( _oidvector PGNSP PGUID -1 f b t \054 0 30 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1014 ( _bpchar PGNSP PGUID -1 f b t \054 0 1042 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1015 ( _varchar PGNSP PGUID -1 f b t \054 0 1043 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1016 ( _int8 PGNSP PGUID -1 f b t \054 0 20 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1017 ( _point PGNSP PGUID -1 f b t \054 0 600 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1018 ( _lseg PGNSP PGUID -1 f b t \054 0 601 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1019 ( _path PGNSP PGUID -1 f b t \054 0 602 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1020 ( _box PGNSP PGUID -1 f b t \073 0 603 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1021 ( _float4 PGNSP PGUID -1 f b t \054 0 700 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1022 ( _float8 PGNSP PGUID -1 f b t \054 0 701 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1023 ( _abstime PGNSP PGUID -1 f b t \054 0 702 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1024 ( _reltime PGNSP PGUID -1 f b t \054 0 703 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1025 ( _tinterval PGNSP PGUID -1 f b t \054 0 704 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1027 ( _polygon PGNSP PGUID -1 f b t \054 0 604 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1033 ( aclitem PGNSP PGUID 12 f b t \054 0 0 aclitemin aclitemout - - pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("access control list"); #define ACLITEMOID 1033 ! DATA(insert OID = 1034 ( _aclitem PGNSP PGUID -1 f b t \054 0 1033 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1040 ( _macaddr PGNSP PGUID -1 f b t \054 0 829 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1041 ( _inet PGNSP PGUID -1 f b t \054 0 869 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 651 ( _cidr PGNSP PGUID -1 f b t \054 0 650 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1042 ( bpchar PGNSP PGUID -1 f b t \054 0 0 bpcharin bpcharout bpcharrecv bpcharsend pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); DESCR("char(length), blank-padded string, fixed storage length"); #define BPCHAROID 1042 ! DATA(insert OID = 1043 ( varchar PGNSP PGUID -1 f b t \054 0 0 varcharin varcharout varcharrecv varcharsend pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); DESCR("varchar(length), non-blank-padded string, variable storage length"); #define VARCHAROID 1043 ! DATA(insert OID = 1082 ( date PGNSP PGUID 4 t b t \054 0 0 date_in date_out date_recv date_send pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("ANSI SQL date"); #define DATEOID 1082 ! DATA(insert OID = 1083 ( time PGNSP PGUID 8 f b t \054 0 0 time_in time_out time_recv time_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("hh:mm:ss, ANSI SQL time"); #define TIMEOID 1083 /* OIDS 1100 - 1199 */ ! DATA(insert OID = 1114 ( timestamp PGNSP PGUID 8 f b t \054 0 0 timestamp_in timestamp_out timestamp_recv timestamp_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("date and time"); #define TIMESTAMPOID 1114 ! DATA(insert OID = 1115 ( _timestamp PGNSP PGUID -1 f b t \054 0 1114 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1182 ( _date PGNSP PGUID -1 f b t \054 0 1082 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1183 ( _time PGNSP PGUID -1 f b t \054 0 1083 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1184 ( timestamptz PGNSP PGUID 8 f b t \054 0 0 timestamptz_in timestamptz_out timestamptz_recv timestamptz_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("date and time with time zone"); #define TIMESTAMPTZOID 1184 ! DATA(insert OID = 1185 ( _timestamptz PGNSP PGUID -1 f b t \054 0 1184 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1186 ( interval PGNSP PGUID 12 f b t \054 0 0 interval_in interval_out interval_recv interval_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("@ , time interval"); #define INTERVALOID 1186 ! DATA(insert OID = 1187 ( _interval PGNSP PGUID -1 f b t \054 0 1186 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); /* OIDS 1200 - 1299 */ ! DATA(insert OID = 1231 ( _numeric PGNSP PGUID -1 f b t \054 0 1700 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1266 ( timetz PGNSP PGUID 12 f b t \054 0 0 timetz_in timetz_out timetz_recv timetz_send pg_analyze_alg_default d p f 0 -1 0 _null_ _null_ )); DESCR("hh:mm:ss, ANSI SQL time"); #define TIMETZOID 1266 ! DATA(insert OID = 1270 ( _timetz PGNSP PGUID -1 f b t \054 0 1266 array_in array_out array_recv array_send pg_analyze_alg_default d x f 0 -1 0 _null_ _null_ )); /* OIDS 1500 - 1599 */ ! DATA(insert OID = 1560 ( bit PGNSP PGUID -1 f b t \054 0 0 bit_in bit_out bit_recv bit_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); DESCR("fixed-length bit string"); #define BITOID 1560 ! DATA(insert OID = 1561 ( _bit PGNSP PGUID -1 f b t \054 0 1560 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 1562 ( varbit PGNSP PGUID -1 f b t \054 0 0 varbit_in varbit_out varbit_recv varbit_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); DESCR("variable-length bit string"); #define VARBITOID 1562 ! DATA(insert OID = 1563 ( _varbit PGNSP PGUID -1 f b t \054 0 1562 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); /* OIDS 1600 - 1699 */ /* OIDS 1700 - 1799 */ ! DATA(insert OID = 1700 ( numeric PGNSP PGUID -1 f b t \054 0 0 numeric_in numeric_out numeric_recv numeric_send pg_analyze_alg_default i m f 0 -1 0 _null_ _null_ )); DESCR("numeric(precision, decimal), arbitrary precision number"); #define NUMERICOID 1700 ! DATA(insert OID = 1790 ( refcursor PGNSP PGUID -1 f b t \054 0 0 textin textout textrecv textsend pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); DESCR("reference cursor (portal name)"); #define REFCURSOROID 1790 /* OIDS 2200 - 2299 */ ! DATA(insert OID = 2201 ( _refcursor PGNSP PGUID -1 f b t \054 0 1790 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2202 ( regprocedure PGNSP PGUID 4 t b t \054 0 0 regprocedurein regprocedureout regprocedurerecv regproceduresend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("registered procedure (with args)"); #define REGPROCEDUREOID 2202 ! DATA(insert OID = 2203 ( regoper PGNSP PGUID 4 t b t \054 0 0 regoperin regoperout regoperrecv regopersend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("registered operator"); #define REGOPEROID 2203 ! DATA(insert OID = 2204 ( regoperator PGNSP PGUID 4 t b t \054 0 0 regoperatorin regoperatorout regoperatorrecv regoperatorsend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("registered operator (with args)"); #define REGOPERATOROID 2204 ! DATA(insert OID = 2205 ( regclass PGNSP PGUID 4 t b t \054 0 0 regclassin regclassout regclassrecv regclasssend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("registered class"); #define REGCLASSOID 2205 ! DATA(insert OID = 2206 ( regtype PGNSP PGUID 4 t b t \054 0 0 regtypein regtypeout regtyperecv regtypesend pg_analyze_alg_default i p f 0 -1 0 _null_ _null_ )); DESCR("registered type"); #define REGTYPEOID 2206 ! DATA(insert OID = 2207 ( _regprocedure PGNSP PGUID -1 f b t \054 0 2202 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2208 ( _regoper PGNSP PGUID -1 f b t \054 0 2203 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2209 ( _regoperator PGNSP PGUID -1 f b t \054 0 2204 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2210 ( _regclass PGNSP PGUID -1 f b t \054 0 2205 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); ! DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b t \054 0 2206 array_in array_out array_recv array_send pg_analyze_alg_default i x f 0 -1 0 _null_ _null_ )); /* * pseudo-types *************** *** 519,543 **** * argument and result types (if supported by the function's implementation * language). */ ! DATA(insert OID = 2249 ( record PGNSP PGUID 4 t p t \054 0 0 record_in record_out record_recv record_send i p f 0 -1 0 _null_ _null_ )); #define RECORDOID 2249 ! DATA(insert OID = 2275 ( cstring PGNSP PGUID -2 f p t \054 0 0 cstring_in cstring_out cstring_recv cstring_send c p f 0 -1 0 _null_ _null_ )); #define CSTRINGOID 2275 ! DATA(insert OID = 2276 ( any PGNSP PGUID 4 t p t \054 0 0 any_in any_out - - i p f 0 -1 0 _null_ _null_ )); #define ANYOID 2276 ! DATA(insert OID = 2277 ( anyarray PGNSP PGUID -1 f p t \054 0 0 anyarray_in anyarray_out anyarray_recv anyarray_send i x f 0 -1 0 _null_ _null_ )); #define ANYARRAYOID 2277 ! DATA(insert OID = 2278 ( void PGNSP PGUID 4 t p t \054 0 0 void_in void_out - - i p f 0 -1 0 _null_ _null_ )); #define VOIDOID 2278 ! DATA(insert OID = 2279 ( trigger PGNSP PGUID 4 t p t \054 0 0 trigger_in trigger_out - - i p f 0 -1 0 _null_ _null_ )); #define TRIGGEROID 2279 ! DATA(insert OID = 2280 ( language_handler PGNSP PGUID 4 t p t \054 0 0 language_handler_in language_handler_out - - i p f 0 -1 0 _null_ _null_ )); #define LANGUAGE_HANDLEROID 2280 ! DATA(insert OID = 2281 ( internal PGNSP PGUID 4 t p t \054 0 0 internal_in internal_out - - i p f 0 -1 0 _null_ _null_ )); #define INTERNALOID 2281 ! DATA(insert OID = 2282 ( opaque PGNSP PGUID 4 t p t \054 0 0 opaque_in opaque_out - - i p f 0 -1 0 _null_ _null_ )); #define OPAQUEOID 2282 ! DATA(insert OID = 2283 ( anyelement PGNSP PGUID 4 t p t \054 0 0 anyelement_in anyelement_out - - i p f 0 -1 0 _null_ _null_ )); #define ANYELEMENTOID 2283 /* --- 525,549 ---- * argument and result types (if supported by the function's implementation * language). */ ! DATA(insert OID = 2249 ( record PGNSP PGUID 4 t p t \054 0 0 record_in record_out record_recv record_send - i p f 0 -1 0 _null_ _null_ )); #define RECORDOID 2249 ! DATA(insert OID = 2275 ( cstring PGNSP PGUID -2 f p t \054 0 0 cstring_in cstring_out cstring_recv cstring_send - c p f 0 -1 0 _null_ _null_ )); #define CSTRINGOID 2275 ! DATA(insert OID = 2276 ( any PGNSP PGUID 4 t p t \054 0 0 any_in any_out - - - i p f 0 -1 0 _null_ _null_ )); #define ANYOID 2276 ! DATA(insert OID = 2277 ( anyarray PGNSP PGUID -1 f p t \054 0 0 anyarray_in anyarray_out anyarray_recv anyarray_send - i x f 0 -1 0 _null_ _null_ )); #define ANYARRAYOID 2277 ! DATA(insert OID = 2278 ( void PGNSP PGUID 4 t p t \054 0 0 void_in void_out - - - i p f 0 -1 0 _null_ _null_ )); #define VOIDOID 2278 ! DATA(insert OID = 2279 ( trigger PGNSP PGUID 4 t p t \054 0 0 trigger_in trigger_out - - - i p f 0 -1 0 _null_ _null_ )); #define TRIGGEROID 2279 ! DATA(insert OID = 2280 ( language_handler PGNSP PGUID 4 t p t \054 0 0 language_handler_in language_handler_out - - - i p f 0 -1 0 _null_ _null_ )); #define LANGUAGE_HANDLEROID 2280 ! DATA(insert OID = 2281 ( internal PGNSP PGUID 4 t p t \054 0 0 internal_in internal_out - - - i p f 0 -1 0 _null_ _null_ )); #define INTERNALOID 2281 ! DATA(insert OID = 2282 ( opaque PGNSP PGUID 4 t p t \054 0 0 opaque_in opaque_out - - - i p f 0 -1 0 _null_ _null_ )); #define OPAQUEOID 2282 ! DATA(insert OID = 2283 ( anyelement PGNSP PGUID 4 t p t \054 0 0 anyelement_in anyelement_out - - - i p f 0 -1 0 _null_ _null_ )); #define ANYELEMENTOID 2283 /* *************** *** 557,562 **** --- 563,569 ---- Oid outputProcedure, Oid receiveProcedure, Oid sendProcedure, + Oid analyzeProcedure, Oid elementType, Oid baseType, const char *defaultTypeValue, *************** *** 576,581 **** --- 583,589 ---- Oid outputProcedure, Oid receiveProcedure, Oid sendProcedure, + Oid analyzeProcedure, Oid elementType, Oid baseType, Node *defaultExpr, Only in /home/pg74/pg_cvs/pgsql/src/include/catalog: pg_type.h.orig diff -rc src/include/commands/vacuum.h /home/pg74/pg_cvs/pgsql/src/include/commands/vacuum.h *** src/include/commands/vacuum.h Fri Jan 23 15:45:55 2004 --- /home/pg74/pg_cvs/pgsql/src/include/commands/vacuum.h Fri Jan 23 10:18:11 2004 *************** *** 25,30 **** --- 25,33 ---- #include "nodes/parsenodes.h" #include "utils/rel.h" + #include "catalog/pg_attribute.h" + #include "catalog/pg_type.h" + #include "catalog/pg_statistic.h" /* State structure for vac_init_rusage/vac_show_rusage */ *************** *** 59,63 **** --- 62,101 ---- /* in commands/analyze.c */ extern void analyze_rel(Oid relid, VacuumStmt *vacstmt); + extern Datum pg_analyze_alg_default(PG_FUNCTION_ARGS); + + /* + * We build one of these structs for each attribute (column) that is to be + * analyzed. The struct and subsidiary data are in anl_context, + * so they live until the end of the ANALYZE operation. + */ + typedef struct + { + /* These fields are set up by examine_attribute */ + int attnum; /* attribute number */ + Form_pg_attribute attr; /* copy of pg_attribute row for column */ + Form_pg_type attrtype; /* copy of pg_type row for column */ + MemoryContext anl_context; /* the memory context required for returning data */ + + /* These fields should be set by a user-specified analysis function */ + int minrows; /* Minimum # of rows wanted for stats */ + void *algfunc; /* Point to statistics computation function */ + + /* + * These fields are filled in by the actual statistics-gathering + * routine + */ + + bool stats_valid; + float4 stanullfrac; /* fraction of entries that are NULL */ + int4 stawidth; /* average width */ + float4 stadistinct; /* # distinct values */ + int2 stakind[STATISTIC_NUM_SLOTS]; + Oid staop[STATISTIC_NUM_SLOTS]; + int numnumbers[STATISTIC_NUM_SLOTS]; + float4 *stanumbers[STATISTIC_NUM_SLOTS]; + int numvalues[STATISTIC_NUM_SLOTS]; + Datum *stavalues[STATISTIC_NUM_SLOTS]; + } VacAttrStats; #endif /* VACUUM_H */