X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 5B34FF00E6 for ; Sun, 8 Jun 2003 22:34:58 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 22714-02 for ; Sun, 8 Jun 2003 22:34:48 +0000 (GMT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 87EBBF005C for ; Sun, 8 Jun 2003 22:34:47 +0000 (GMT) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 1800142; Sun, 08 Jun 2003 15:10:41 -0700 Message-ID: <3EE3B9CC.8060600@joeconway.com> Date: Sun, 08 Jun 2003 15:33:48 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Mr Weinbach, Larry" Cc: pgsql-sql@postgresql.org Subject: Re: Using a RETURN NEXT References: <20030606221435.44876.qmail@web12906.mail.yahoo.com> In-Reply-To: <20030606221435.44876.qmail@web12906.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/56 X-Sequence-Number: 13814 Mr Weinbach, Larry wrote: > But at execution time I am getting thi error : > > WARNING: Error occurred while executing PL/pgSQL > function word_case > WARNING: line 5 at return next > ERROR: Set-valued function called in context that > cannot accept a set > You didn't show the execution time SQL statement, but the error you are getting usually indicates you did something like: SELECT word_case(); but you should have done: (define the function to return setof record) SELECT * FROM word_case() AS (message text); or CREATE TYPE word_case_type AS (message text); (define the function to return setof word_case_type) SELECT * FROM word_case(); HTH, Joe