Re: interperting type oid in C code

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Ken Been *EXTERN*'" <kbbeen(at)gmail(dot)com>, Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: interperting type oid in C code
Date: 2015-10-20 09:19:38
Message-ID: A737B7A37273E048B164557ADEF4A58B50FBC59F@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ken Been wrote:
> 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?

> Thanks, but I actually wanted to do it from C code. But anyway I think I found the answer: use the
> symbolic constants in catalog/pg_type.h, such as INT4OID.

That's fine, there is no problem with doing that.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nicolas Paris 2015-10-20 09:28:21 Re: PSQL Tools
Previous Message Birta Levente 2015-10-20 08:14:40 RAID and SSD configuration question