Re: Function returns composite type - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Function returns composite type
Date
Msg-id 3EE61712.8@joeconway.com
Whole thread Raw
In response to Re: Function returns composite type  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: Function returns composite type  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
Teodor Sigaev wrote:
> Ok, RECORD was a keyword, thank you. But I have questions:
> 1 What do you mean SRF? Set Return Function?

It refers to functions returning one or more tuples. From a practical 
standpoint, it is a function that is (and must be) used in the FROM 
clause like a table (hence also known as a "table function").
> # select * from qqn(1,2) as c(qq int4, qq1 int4);>  qq | qq1> ----+----->   1 |   2> (1 row)>
> It works fine. But is there way not to point 'as c(qq int4, qq1 int4)'? 

If you mean, is there a way to leave out the 'as c(qq int4, qq1 int4)', 
the answer is no. You need to either declare the function to return a 
determinate data type, or you have to specify the data type at runtime 
in the query string.

Joe




pgsql-hackers by date:

Previous
From: "Martin D. Weinberg"
Date:
Subject: Re: [GENERAL] Postgresql & AMD x86-64
Next
From: Peter Eisentraut
Date:
Subject: Re: Groups and roles