Re: help with version checking

From: Arnau <arnaulist(at)andromeiberica(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: help with version checking
Date: 2006-12-28 17:50:59
Message-ID: 45940403.4010909@andromeiberica.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-12-28 17:56:27 Re: help with version checking
Previous Message Daniel CAUNE 2006-12-28 17:45:02 Re: help with version checking