From: a <372660931@qq.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How can I retrieve attribute category with attribute Oid in Cfunction?
Date: Mon, 14 May 2018 16:23:47 +0800
Message-ID: <tencent_606B0B5934AF9371386035F8@qq.com> (raw)
In-Reply-To: <tencent_0D0D19BB70A735647D39E796@qq.com>
References: <tencent_1848C2CD1C95FC5161268968@qq.com>
<1526285495.2675.10.camel@cybertec.at>
<tencent_0D0D19BB70A735647D39E796@qq.com>
BTW, I searched another function called "lookup_type_cache", which will return a pointer of structure of "TypeCacheEntry".
The structure contains "TypeCacheEntry.typtype" that may also help to identify the type.
But I'm concerning about possible memory leak and allocation stuff. Is it safe to just declare a pointer and call this function??
------------------ Original ------------------
From: "372660931@qq.com";<372660931@qq.com>;
Date: May 14, 2018
To: "Laurenz Albe"<laurenz.albe@cybertec.at>; "pgsql-general"<pgsql-general@postgresql.org>;
Subject: Re: How can I retrieve attribute category with attribute Oid in Cfunction?
hey thank you!!
could you provide some more detail information??
What function should I use to get FormData_pg_type structure??
thanks a lot
------------------ Original message ------------------
From: "Laurenz Albe";
Sendtime: Monday, May 14, 2018 4:11 PM
To: "a"<372660931@qq.com>; "pgsql-general";
Subject: Re: How can I retrieve attribute category with attribute Oid in Cfunction?
a wrote:
> Hi I am writing something that would need to identify the attribute category inside a C function,
> now I may need a way of fast access it, but the information is not stored in FormData_pg_attribute structure.
Are you talking about pg_type.typcategory?
That is accessible from FormData_pg_type.
You'd have to look up atttypid in the TYPEOID cache.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: 372660931@qq.com, laurenz.albe@cybertec.at
Subject: Re: How can I retrieve attribute category with attribute Oid in Cfunction?
In-Reply-To: <tencent_606B0B5934AF9371386035F8@qq.com>
References: <tencent_1848C2CD1C95FC5161268968@qq.com> <1526285495.2675.10.camel@cybertec.at> <tencent_0D0D19BB70A735647D39E796@qq.com> <tencent_606B0B5934AF9371386035F8@qq.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox