Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D41731337B5C for ; Thu, 4 Nov 2010 00:50:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 37118-07 for ; Thu, 4 Nov 2010 03:50:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 7F73D1337B5B for ; Thu, 4 Nov 2010 00:50:12 -0300 (ADT) 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 oA43o8DK019969; Wed, 3 Nov 2010 23:50:08 -0400 (EDT) To: Ralph Smith cc: pgsql-sql@postgresql.org Subject: Re: I'm stuck - I just can't get this small FUNCT to run! In-reply-to: <4CD1F792.6040907@10kinfo.com> References: <4CD1F792.6040907@10kinfo.com> Comments: In-reply-to Ralph Smith message dated "Wed, 03 Nov 2010 17:00:18 -0700" Date: Wed, 03 Nov 2010 23:50:08 -0400 Message-ID: <19968.1288842608@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/7 X-Sequence-Number: 34745 Ralph Smith writes: > I'm also stuck on 7.4 for at least a few more months, but that's not > part of the problem. ... well, actually, it is; because newer versions give considerably more helpful syntax error messages. I tried plugging this function into a current version, and got syntax error at or near "daRec" LINE 34: FOR daRec IN SELECT * FROM temp_salesimport WHERE offer_... ^ which was at least close enough to the problem (the missing semi on the previous line) to be of some use, unlike the error pointing at line 92. Similarly, after fixing the first missing semi I got ERROR: syntax error at or near "select" LINE 38: select into vBusOwnerID businessownerid from business ... ^ which is just after the other one. If you aren't in a position to move your production DB yet, you might at least consider using a newer version for development. That has its own hazards of course, like accidentally using features that don't exist in 7.4, but it could save you a lot of time in cases like this. regards, tom lane