Re: [GENERAL] Get user defined type OID (PostgreSQL extension in C) - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: [GENERAL] Get user defined type OID (PostgreSQL extension in C)
Date
Msg-id 8ec9ed88-ac8f-dd6e-133f-d4a9914bd66b@2ndquadrant.com
Whole thread Raw
In response to [GENERAL] Get user defined type OID (PostgreSQL extension in C)  (Fabiana Zioti <fabi_zioti@hotmail.com>)
List 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


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] Invalid magic number 0000 in log file
Next
From: "Zhu, Joshua"
Date:
Subject: [GENERAL] BDR replication port