2416{
2417 HeapTuple att_tuple;
2418 Form_pg_attribute att;
2419
2420 if (!attnum || !atttypid)
2421 elog(ERROR, "%s got null input parameters", __func__);
2422
2423
2424 att_tuple = SearchSysCache2(ATTNAME,
2425 ObjectIdGetDatum(table_oid),
2426 PointerGetDatum(col));
2427
2428 if (!HeapTupleIsValid(att_tuple))
2429 return false;
2430
2431 att = (Form_pg_attribute) GETSTRUCT(att_tuple);
2432 *atttypid = att->atttypid;
2433 *attnum = att->attnum;
2434 ReleaseSysCache(att_tuple);
2435 return true;
2436}