Re: Set-returning function syntax

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: mail(at)joeconway(dot)com
Cc: joel(at)joelburton(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Set-returning function syntax
Date: 2002-05-19 00:03:11
Message-ID: 20020519.090311.74752356.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Does your SRF function allow to return a setof composite data type
using C function? If so, how can I write such that C function? I
couldn't find any example or explanation so far. You referred dblink,
but in my understanding it does not have any function that returns a
setof composite data type.
--
Tatsuo Ishii

> Attached is the script I've been using to test as I go. It shows the
> usage of SRFs in a variety of situations (note that the C function tests
> require contrib/dblink installed). There's also a description in one of
> my earlier posts. Here is a recap, edited to the latest reality:
>
> How it currently works:
> -----------------------
> 1. The SRF may be either marked as returning a set or not. A function
> not marked as returning a set simply produces one row.
>
> 2. The SRF may either return a base data type (e.g. TEXT) or a composite
> data type (e.g. pg_class). If the function returns a base data type, the
> single result column is named for the function. If the function returns
> a composite type, the result columns get the same names as the
> individual attributes of the type.
>
> 3. The SRF may be aliased in the FROM clause, but it also be left
> unaliased. If a function is used in the FROM clause with no alias, the
> function name is used as the relation name.
>
> Hope that's a start.
>
> Thanks,
>
> Joe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-05-19 00:17:48 Re: Set-returning function syntax
Previous Message Neil Conway 2002-05-19 00:00:00 Re: Sequence privileges