PostGIS  2.1.10dev-r@@SVN_REVISION@@
static ND_STATS* pg_get_nd_stats_by_name ( const Oid  table_oid,
const text *  att_text,
int  mode 
)
static

Pull the stats object from the PgSQL system catalogs.

The debugging functions are taking human input (table names) and columns, so we have to look those up first.

Definition at line 855 of file gserialized_estimate.c.

References pg_get_nd_stats(), and text2cstring().

Referenced by _postgis_gserialized_joinsel(), _postgis_gserialized_sel(), _postgis_gserialized_stats(), and gserialized_estimated_extent().

856 {
857  const char *att_name = text2cstring(att_text);
858  AttrNumber att_num;
859 
860  /* We know the name? Look up the num */
861  if ( att_text )
862  {
863  /* Get the attribute number */
864  att_num = get_attnum(table_oid, att_name);
865  if ( ! att_num ) {
866  elog(ERROR, "attribute \"%s\" does not exist", att_name);
867  return NULL;
868  }
869  }
870  else
871  {
872  elog(ERROR, "attribute name is null");
873  return NULL;
874  }
875 
876  return pg_get_nd_stats(table_oid, att_num, mode);
877 }
char * text2cstring(const text *textptr)
static ND_STATS * pg_get_nd_stats(const Oid table_oid, AttrNumber att_num, int mode)
Pull the stats object from the PgSQL system catalogs.

Here is the call graph for this function:

Here is the caller graph for this function: