Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id AB4962E028C for ; Thu, 6 Mar 2008 14:14:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 87728-01 for ; Thu, 6 Mar 2008 14:14:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1D8692E01C7 for ; Thu, 6 Mar 2008 14:14:18 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m26IEFUa019150; Thu, 6 Mar 2008 13:14:15 -0500 (EST) To: Richard Huxton cc: Yura Gal , pgsql-sql@postgresql.org Subject: Re: RETURN QUERY generates error In-reply-to: <47CFAA53.7010309@archonet.com> References: <3b6c69d80803052345g31af3b74k6b8878c65197d621@mail.gmail.com> <47CFAA53.7010309@archonet.com> Comments: In-reply-to Richard Huxton message dated "Thu, 06 Mar 2008 08:24:51 +0000" Date: Thu, 06 Mar 2008 13:14:15 -0500 Message-ID: <19149.1204827255@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/26 X-Sequence-Number: 30354 Richard Huxton writes: > Yura Gal wrote: >> all is fine until the last IF. Both RETURN QUERY blocks generate >> error: 'syntax error at or near SELECT ...' I feel that something >> wrong with casting _sequence var but I can't figure out the exact >> point. > Can't think why it's not happy - if I create an empty table to go with > it, it runs here. The error sounds suspiciously like what would happen if you tried to use RETURN QUERY in a pre-8.3 version. regards, tom lane