Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id E0C4B9FA1DA for ; Thu, 28 Dec 2006 14:15:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 53822-05 for ; Thu, 28 Dec 2006 14:14:53 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id 22A949F9F47 for ; Thu, 28 Dec 2006 14:15:00 -0400 (AST) Received: by fafnir.androme.com (Postfix, from userid 1003) id 33C0EB93D5A; Thu, 28 Dec 2006 19:14:59 +0100 (CET) Message-ID: <459409A2.9020103@andromeiberica.com> Date: Thu, 28 Dec 2006 19:14:58 +0100 From: Arnau Reply-To: arnaulist@andromeiberica.com User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: help with version checking References: <000001c72aa7$e705f1e0$0b00a8c0@tedy> <45940403.4010909@andromeiberica.com> <21284.1167328587@sss.pgh.pa.us> In-Reply-To: <21284.1167328587@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/180 X-Sequence-Number: 27136 Tom Lane wrote: > Arnau writes: >> I don't want, if it's possible, to create a function. > > Unlike Oracle, PG makes a strong distinction between SQL and > programmable languages (including plpgsql). You can't write > plpgsql code without putting it into a function. > > regards, tom lane > I've tried Daniel's suggestion but the Raise doesn't terminate the script execution, so if doesn't do what I need. Notice the Update 1 arebassa@beowulf:~$ psql -d dermagier -f upgrade_agenda.sql CREATE FUNCTION psql:upgrade_agenda.sql:16: ERROR: This script needs Agenda version 1.0.0.0, detected version 1.0.0.1 UPDATE 1 -- Arnau