Received: from www-uk-05.digiserve.com ([195.97.231.11]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f2EGYOx37507 for ; Wed, 14 Mar 2001 11:34:24 -0500 (EST) (envelope-from dev@archonet.com) Received: from mainbox.archonet.com (mwynhau.demon.co.uk [193.237.186.96]) by www-uk-05.digiserve.com (8.9.1/8.9.1) with ESMTP id QAA23252; Wed, 14 Mar 2001 16:35:12 GMT Received: from client (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with SMTP id BF40E2A683; Wed, 14 Mar 2001 16:24:18 +0000 (GMT) Message-ID: <005001c0aca3$37208a20$1001a8c0@archonet.com> From: "Richard Huxton" To: "Tim Perdue" , References: <20010314085635.O670@mail.perdue.net> Subject: Re: PL/pgSQL "compilation error" Date: Wed, 14 Mar 2001 16:24:15 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200103/279 X-Sequence-Number: 1940 From: "Tim Perdue" > Hello all - I apologize for the newbie-esque question, but the debug output > from postgres when you have a bug in your PL/pgSQL procedure is none to > detailed. > > I've created the following procedure and am getting an error when I try to > update the table. The error is something like "parse error near ; on line 50". > Line 50 is the last line. You're writing 50 line functions and you're calling yourself a newbie? Hate to think what that makes me. > There's probably something glaring wrong in here that I'm not seeing, but any > help would be appreciated. Nothing huge leaps out at me except for the \ and the occasional lower-case 'new' - don't know if 'new' is the same as 'NEW' - not sure I've tried it. I have used statements on multiple lines without the \ though, so it might be worth snipping them and seeing what happens. > I don't know if the \ at the end of the line is a problem, but those were > added late in the game and didn't change the error message ;-) [snip] > UPDATE artifact_counts_agg SET open_count=open_count-1 \ > WHERE group_artifact_id=new.group_artifact_id; Failing that, email me the definition of artifacts_count_agg and artifact and I'll play with it here. - Richard Huxton