pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: a <372660931@qq.com>
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 10:51:29 +0200
Message-ID: <1526287889.2675.14.camel@cybertec.at> (raw)
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>

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




view thread (5+ messages)

Message-ID: <1526287889.2675.14.camel@cybertec.at>
Permalink:  ../1526287889.2675.14.camel@cybertec.at/
Also on:    postgresql.org/message-id/1526287889.2675.14.camel@cybertec.at

 · 

reply

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: laurenz.albe@cybertec.at, 372660931@qq.com
  Subject: Re: How can I retrieve attribute category with attribute Oid in Cfunction?
  In-Reply-To: <1526287889.2675.14.camel@cybertec.at>
  References: <tencent_1848C2CD1C95FC5161268968@qq.com> <1526285495.2675.10.camel@cybertec.at> <tencent_0D0D19BB70A735647D39E796@qq.com> <tencent_606B0B5934AF9371386035F8@qq.com> <1526287889.2675.14.camel@cybertec.at>

* 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