From: Arnau <arnaulist@andromeiberica.com>
To: pgsql-sql@postgresql.org
Subject: Re: help with version checking
Date: Thu, 28 Dec 2006 18:50:59 +0100
Message-ID: <45940403.4010909@andromeiberica.com> (raw)
In-Reply-To: <000001c72aa7$e705f1e0$0b00a8c0@tedy>
References: <000001c72aa7$e705f1e0$0b00a8c0@tedy>
Hi Daniel,
> You should define a PL/PGSQL function such as:
>
> CREATE OR REPLACE FUNCTION check_version()
> RETURNS void
> AS $$
> DECLARE
> v_version VARCHAR;
> BEGIN
> SELECT version INTO v_version FROM version WHERE id = 1;
>
> IF v_version <> '1.0.0.0' THEN
> RAISE EXCEPTION 'This script needs Agenda version 1.0.0.0, detected
> version %', v_version;
> END IF;
> END;
> $$ LANGUAGE PLPGSQL;
I don't want, if it's possible, to create a function. I just want to
check a value stored in a table and if doesn't match the expected one
then abort the script execution.
--
Arnau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: arnaulist@andromeiberica.com
Subject: Re: help with version checking
In-Reply-To: <45940403.4010909@andromeiberica.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox