Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fI8aL-0001PT-7u for pgsql-general@arkaria.postgresql.org; Mon, 14 May 2018 08:11:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fI8aK-0003FQ-16 for pgsql-general@arkaria.postgresql.org; Mon, 14 May 2018 08:11:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fI8aJ-0003Bv-LS for pgsql-general@lists.postgresql.org; Mon, 14 May 2018 08:11:55 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fI8aB-0005Lq-Vr for pgsql-general@postgresql.org; Mon, 14 May 2018 08:11:54 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id CAD6D413CC; Mon, 14 May 2018 10:11:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id ChDsX01xIu2S; Mon, 14 May 2018 10:11:37 +0200 (CEST) Message-ID: <1526285495.2675.10.camel@cybertec.at> Subject: Re: How can I retrieve attribute category with attribute Oid in C function? From: Laurenz Albe To: a <372660931@qq.com>, pgsql-general Date: Mon, 14 May 2018 10:11:35 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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