function return type is a setof some column type

Поиск
Список
Период
Сортировка
Искать
От
Murat Tasan
Тема
function return type is a setof some column type
Дата
Msg-id
18226A8C-71D1-48D0-ADA1-273259B6932D@cwru.edu
Список
Дерево обсуждения
function return type is a setof some column type Murat Tasan <murat.tasan@cwru.edu>
Re: function return type is a setof some column type Murat Tasan <murat.tasan@cwru.edu>
Re: function return type is a setof some column type Stephan Szabo <sszabo@megazone.bigpanda.com>
hi all, i'm new to the list, so if this is an off-topic question, or  
has already been posed, i apologize...

i'm trying to figure out how to get the following test situation to  
work:

creating a function like below fails...

CREATE FUNCTION test_function() RETURNS SETOF table.column%TYPE AS $$  
SELECT 1; $$ LANGUAGE SQL;

yet i know the %TYPE format works because the below succeeds...

CREATE FUNCTION test_function() RETURNS table.column%TYPE AS $$  
SELECT 1; $$ LANGUAGE SQL;

as does the SETOF option because the following also succeeds...

CREATE FUNCTION test_function() RETURNS SETOF int4 AS $$ SELECT 1; $$  
LANGUAGE SQL;

can anyone help me figure out how to get the first function  
declaration to work?
and yes, i know i could just look up the type of the column of  
interest, but i'm trying to make the function somewhat independent of  
table alterations (the whole reason for the %TYPE inclusion in  
postgresql in the first place!)

thanks for any help!

murat
В списке pgsql-novice по дате отправления
От: Paul Smith
Дата:
От: Web2cad
Дата:
FAQ