2270 char *nsp_tbl = NULL;
2274 bool only_parent =
FALSE;
2276 if ( PG_NARGS() == 4 )
2280 col = PG_GETARG_TEXT_P(2);
2281 only_parent = PG_GETARG_BOOL(3);
2282 nsp_tbl = palloc(strlen(nsp) + strlen(tbl) + 6);
2283 sprintf(nsp_tbl,
"\"%s\".\"%s\"", nsp, tbl);
2284 tbl_oid = DatumGetObjectId(DirectFunctionCall1(regclassin, CStringGetDatum(nsp_tbl)));
2287 else if ( PG_NARGS() == 3 )
2291 col = PG_GETARG_TEXT_P(2);
2292 nsp_tbl = palloc(strlen(nsp) + strlen(tbl) + 6);
2293 sprintf(nsp_tbl,
"\"%s\".\"%s\"", nsp, tbl);
2294 tbl_oid = DatumGetObjectId(DirectFunctionCall1(regclassin, CStringGetDatum(nsp_tbl)));
2297 else if ( PG_NARGS() == 2 )
2300 col = PG_GETARG_TEXT_P(1);
2301 nsp_tbl = palloc(strlen(tbl) + 3);
2302 sprintf(nsp_tbl,
"\"%s\"", tbl);
2303 tbl_oid = DatumGetObjectId(DirectFunctionCall1(regclassin, CStringGetDatum(nsp_tbl)));
2308 elog(ERROR,
"estimated_extent() called with wrong number of arguments");
2317 elog(WARNING,
"stats for \"%s.%s\" do not exist", tbl,
text2cstring(col));
2322 gbox = palloc(
sizeof(
GBOX));
2332 PG_RETURN_POINTER(gbox);
static ND_STATS * pg_get_nd_stats_by_name(const Oid table_oid, const text *att_text, int mode, bool only_parent)
Pull the stats object from the PgSQL system catalogs.
#define FLAGS_SET_GEODETIC(flags, value)
#define FLAGS_SET_Z(flags, value)
char * text2cstring(const text *textptr)
N-dimensional statistics structure.
#define FLAGS_SET_M(flags, value)