Re: Set-returning function syntax

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: Set-returning function syntax
Дата
Msg-id 20020519.090311.74752356.t-ishii@sra.co.jp
обсуждение исходный текст
Ответ на Re: Set-returning function syntax  (Joe Conway <mail@joeconway.com>)
Ответы Re: Set-returning function syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: Sequence privileges
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Set-returning function syntax