Definition of return types for own functions?

From: Matthias(dot)Pitzl(at)izb(dot)de
To: pgsql-general(at)postgresql(dot)org
Subject: Definition of return types for own functions?
Date: 2006-09-28 07:46:29
Message-ID: 11EC9A592C31034C88965C87AF18C2A70CFC71@m0000s61
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all!

Is it possible to define a complex return type like a record in a function
without having some table around with the needed structure of the return
values?
For example: if i want a function that returns a date and an integer, i
create the function:

CREATE FUNCTION bla(text) RETURNS SETOF table_name AS '...

And i need the table table_name with the structure:
CREATE TABLE table_name( datum DATE, zahl INTEGER);

Can i somehow define this structe inside the function declaration without
having some empty tables or views around?

Thank you all!

Best regards,
Matthias

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Teodor Sigaev 2006-09-28 07:53:50 Re: cyclical redundancy checksum algorithm(s)?
Previous Message Michael Vodep 2006-09-28 07:26:15 Full Text fuzzy search