Re: Postgresql c function returning one row with 2 fileds - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Postgresql c function returning one row with 2 fileds
Date
Msg-id CA+Tgmob-oFgDyzRLJf+mfeBk68gyufDeY6LKFNjPxRe51C5esA@mail.gmail.com
Whole thread Raw
In response to Postgresql c function returning one row with 2 fileds  (lucamarletta <info@beopen.it>)
List pgsql-hackers
On Sat, Nov 9, 2013 at 5:52 AM, lucamarletta <info@beopen.it> wrote:
> I'm new in postgresql c function and I start following examples.
>
> I want to write a simple function that have inside an SQL and passing
> parameter evaluete anbd return 2 fields as sum (for now to be simpler).
>
> The function below has problem passing the check
>
> (get_call_result_type(fcinfo, &resultTypeId, &resultTupleDesc) !=
> TYPEFUNC_COMPOSITE)

This is checking whether the CREATE FUNCTION statement that you use to
invoke this code is set up to return a composite type; it's
essentially cross-checking your C with your SQL.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Add CREATE support to event triggers
Next
From: Robert Haas
Date:
Subject: Re: Row-security writer-side checks proposal