Re: Set-returning function syntax - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Set-returning function syntax
Date
Msg-id 20020519.090311.74752356.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: Set-returning function syntax  (Joe Conway <mail@joeconway.com>)
Responses Re: Set-returning function syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: Sequence privileges
Next
From: Tom Lane
Date:
Subject: Re: Set-returning function syntax