I'm working on a foreign data wrapper and I want to switch based on the column type. Specifically, if the column type in the external table is the same as in the (locally defined) foreign table then I can get some speedup for some types.
Through the ForeignScanState object I can get TupleDesc and AttInMetadata opjects, and through there I can get the Oid of the column type, but now I'm stumped. How can I programmatically check whether Oid X refers to type int4, or whatever?