Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4C03A9FB4C6 for ; Fri, 30 Mar 2007 17:14:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 75582-01 for ; Fri, 30 Mar 2007 17:14:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id BD90D9FB456 for ; Fri, 30 Mar 2007 17:14:51 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l2UKEmQi023121; Fri, 30 Mar 2007 16:14:49 -0400 (EDT) To: "Brian Jarrett" cc: pgsql-sql@postgresql.org Subject: Re: using sql on v7.4 server to feed stored procedure In-reply-to: <68b897d90703301219p5a891976wf3f0baefc5f85551@mail.gmail.com> References: <68b897d90703301219p5a891976wf3f0baefc5f85551@mail.gmail.com> Comments: In-reply-to "Brian Jarrett" message dated "Fri, 30 Mar 2007 13:19:34 -0600" Date: Fri, 30 Mar 2007 16:14:48 -0400 Message-ID: <23120.1175285688@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/359 X-Sequence-Number: 27997 "Brian Jarrett" writes: > The following statement works on 8.x servers, but not on 7.4 and I > can't figure out how to get it to operate in the earlier version: > select calc_cum_gpa_mp(marking_period_id::TEXT) > from (select distinct marking_period_id from student_mp_stats) as > sms1; > I get the error: > ERROR: syntax error at or near "(" > SQL state: 42601 > Context: compile of PL/pgSQL function "calc_cum_gpa_mp" near line 8 > Can anyone point me in the right direction? You need to look into the referenced plpgsql function; this statement in itself is not at fault. regards, tom lane