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 1fI9Cv-0004po-4e for pgsql-general@arkaria.postgresql.org; Mon, 14 May 2018 08:51:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fI9Cr-0001k6-II for pgsql-general@arkaria.postgresql.org; Mon, 14 May 2018 08:51:45 +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 1fI9Cr-0001jw-7E for pgsql-general@lists.postgresql.org; Mon, 14 May 2018 08:51:45 +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 1fI9Cj-0006JA-EB for pgsql-general@postgresql.org; Mon, 14 May 2018 08:51:43 +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 47C0640ED8; Mon, 14 May 2018 10:51:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id HqsCXV8KjkOd; Mon, 14 May 2018 10:51:31 +0200 (CEST) Message-ID: <1526287889.2675.14.camel@cybertec.at> Subject: Re: How can I retrieve attribute category with attribute Oid in Cfunction? From: Laurenz Albe To: a <372660931@qq.com>, pgsql-general Date: Mon, 14 May 2018 10:51:29 +0200 In-Reply-To: References: <1526285495.2675.10.camel@cybertec.at> 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: > could you provide some more detail information?? > > What function should I use to get FormData_pg_type structure?? > > 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?? In "logicalrep_write_typ" in src/backend/replication/logical/proto.c you can find an example how to get the pg_type values from the OID. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com