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

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: a <372660931(at)qq(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I retrieve attribute category with attribute Oid in Cfunction?
Date: 2018-05-14 08:51:29
Message-ID: 1526287889.2675.14.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yashwanth Govinda Setty 2018-05-14 11:22:22 Recommended way to copy database files on Windows OS (to perform file system level backup)
Previous Message a 2018-05-14 08:23:47 Re: How can I retrieve attribute category with attribute Oid in Cfunction?