Re: Get user defined type OID (PostgreSQL extension in C)

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Fabiana Zioti <fabi_zioti(at)hotmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Get user defined type OID (PostgreSQL extension in C)
Date: 2017-08-25 20:06:55
Message-ID: 8ec9ed88-ac8f-dd6e-133f-d4a9914bd66b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/25/17 14:34, Fabiana Zioti wrote:
> I'm developing an extension to PostgreSQL using C. I created a
> user-defined type called geo_trajc_elem. I also created a function to
> generate an array of this new type.

> In this case, it is not possible to use get_fn_expr_argtype because I am
> not passing the new type as argument but creating it in the function
> itself, correct ?

The array type for a base type is automatically created by CREATE TYPE.
So the type is already there.

What you are (possibly) doing is constructing a value of that array
type. But then the OIDs of all the types involved don't change, and you
can use the standard functions to look up the types of your arguments
and the associated array types.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Zhu, Joshua 2017-08-25 21:49:44 BDR replication port
Previous Message Peter Eisentraut 2017-08-25 20:01:20 Re: Invalid magic number 0000 in log file