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