Re: How can I retrieve attribute category with attribute Oid in Cfunction?

Поиск
Список
Период
Сортировка
От a
Тема Re: How can I retrieve attribute category with attribute Oid in Cfunction?
Дата
Msg-id tencent_606B0B5934AF9371386035F8@qq.com
обсуждение исходный текст
Ответ на Re: How can I retrieve attribute category with attribute Oid in Cfunction?  ("a" <372660931@qq.com>)
Ответы Re: How can I retrieve attribute category with attribute Oid inCfunction?  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: "a"
Дата:
Сообщение: Re: How can I retrieve attribute category with attribute Oid in Cfunction?
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: How can I retrieve attribute category with attribute Oid inCfunction?