PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ pg_get_nd_stats_by_name()

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 869 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().

870 {
871  const char *att_name = text2cstring(att_text);
872  AttrNumber att_num;
873 
874  /* We know the name? Look up the num */
875  if ( att_text )
876  {
877  /* Get the attribute number */
878  att_num = get_attnum(table_oid, att_name);
879  if ( ! att_num ) {
880  elog(ERROR, "attribute \"%s\" does not exist", att_name);
881  return NULL;
882  }
883  }
884  else
885  {
886  elog(ERROR, "attribute name is null");
887  return NULL;
888  }
889 
890  return pg_get_nd_stats(table_oid, att_num, mode);
891 }
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: