Search Postgresql Archives

Re: Return setof values from C-function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 10, 2013 at 9:44 AM, Yuriy Rusinov <yrusinov@xxxxxxxxx> wrote:
> I have added code
>
>         Oid * oids = (Oid *)palloc (2*sizeof (Oid));
>         oids[0] = INT8OID;
>         oids[1] = FLOAT8OID;
>         if (get_call_result_type(fcinfo, oids, &tupdescRes) !=
> TYPEFUNC_COMPOSITE)
>             ereport(ERROR,
>                     (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
>                      errmsg("function returning record called in context "
>                             "that cannot accept type record")));
>
> and try to obtain tupdescRes  from get_call_result_type function, before
> this I do
>
> create type hist_point as (inum bigint, bin float8);
>  and
> create or replace function histogram (varchar, float8, float8, int4) returns
> setof hist_point
>     as '$libdir/libfloader.so', 'histogram' language 'c' strict security
> definer;
>
> but the result does not obtained.

what error are you getting?  Also, I think you are not properly
initializing NULLs array -- that could be your issue.

merlin


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux