Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9BE9B1337B68 for ; Thu, 30 Dec 2010 13:47:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 97983-07 for ; Thu, 30 Dec 2010 17:47:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pv0-f174.google.com (mail-pv0-f174.google.com [74.125.83.174]) by mail.postgresql.org (Postfix) with ESMTP id 07B2B1337B6E for ; Thu, 30 Dec 2010 13:47:12 -0400 (AST) Received: by pva4 with SMTP id 4so2050969pva.19 for ; Thu, 30 Dec 2010 09:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=G3lR7E+4FHjNtmzpygf+sN+6gvYaoXhpmP5rL5YUnrg=; b=Xrd8o48GqqnN17CcZJzyHTjyoEyGOxXKRywjl5qbhqzsiRv51SK+EdtMgpfWzFmesV jOluFN9pPm6jOzLmZ6GSs/q1k/lBTSiuPd4xjJUyRTsl9S+uLlfTY8CIHrAezZjHY/PD qlaW0eZ3/3cLaYuHMn62GPK1rp+gmojiF1Byg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=SY1ZeGp+2LKiG1g0bMQzMB3MpcFlrxkYTERKtRK6dSboW38MBv7/kDX3LnFnqzwSnm URp3eIHtpc9NufVM1VKzWiWiLFbDPqK4GaGrpFFax4l9X8RmNONrWuIEwOrVsBDCOLBa suoye0g/BZG8rsxZcSS/+rJ7r3RRq4BTFFgA8= Received: by 10.142.51.18 with SMTP id y18mr2939334wfy.290.1293731232151; Thu, 30 Dec 2010 09:47:12 -0800 (PST) Received: from [192.168.0.119] (c-24-17-179-185.hsd1.wa.comcast.net [24.17.179.185]) by mx.google.com with ESMTPS id f5sm22754661wfg.2.2010.12.30.09.47.10 (version=SSLv3 cipher=RC4-MD5); Thu, 30 Dec 2010 09:47:11 -0800 (PST) Message-ID: <4D1CC59D.4030805@gmail.com> Date: Thu, 30 Dec 2010 09:47:09 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Pavel Stehule CC: Gary Stainburn , pgsql-sql@postgresql.org Subject: Re: create function problem References: <201012301626.00240.gary.stainburn@ringways.co.uk> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201012/105 X-Sequence-Number: 34941 On 12/30/2010 09:35 AM, Pavel Stehule wrote: > Hello > > you badly use a IF statement. It's not C. Every IF must to finish with END IF > > this is > > IF .. THEN > ELSEIF .. THEN .. > ELSE > END IF > > Regards > > Pavel Stehule To follow up I think the OP was looking for ELSEIF not ELSE IF. Changing the ELSE IF to ELSEIF should fix it. -- Adrian Klaver adrian.klaver@gmail.com