X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6843232A21A for ; Fri, 22 Oct 2004 00:03:40 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99201-02 for ; Thu, 21 Oct 2004 23:03:26 +0000 (GMT) Received: from smtp.uol.com.br (smtpout6.uol.com.br [200.221.11.59]) by svr1.postgresql.org (Postfix) with ESMTP id 2EEDF329E65 for ; Fri, 22 Oct 2004 00:03:27 +0100 (BST) Received: from [127.0.0.1] (unknown [200.213.106.197]) by scorpion6.uol.com.br (Postfix) with ESMTP id CA2B28603 for ; Thu, 21 Oct 2004 20:03:20 -0300 (BRT) Message-ID: <41A11FC4.4040909@uol.com.br> Date: Sun, 21 Nov 2004 20:07:48 -0300 From: =?ISO-8859-1?Q?Andr=E9_Toscano?= User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Functions return a select in a table, which data type I must use? (Brazilian User) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.6 tagged_above=0.0 required=5.0 tests=DATE_IN_FUTURE_96_XX, UPPERCASE_25_50 X-Spam-Level: ** X-Archive-Number: 200410/155 X-Sequence-Number: 19258 Hello, friends. If anybody can help, how can I do a FUNCTION return a result from a SELECT in a table in PostgreSQL? My Problem is the RETURN TYPE from a FUNCTION, I don´t know what I have to use to return the data as a select result. Example: ---------------- DROP FUNCTION ACADEMICO.teste(int4); CREATE FUNCTION ACADEMICO.teste(int4) RETURNS ????? AS ' select cod_aluno, nome, cpf from ACADEMICO.TB_alunos ' LANGUAGE 'SQL'; ---------------------------------- Thanks in Advance André Toscano (Brazilian user)