Re: help with version checking - Mailing list pgsql-sql

From Arnau
Subject Re: help with version checking
Date
Msg-id 45940403.4010909@andromeiberica.com
Whole thread Raw
In response to help with version checking  (Arnau <arnaulist@andromeiberica.com>)
Responses Re: help with version checking
List 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


pgsql-sql by date:

Previous
From: Arnau
Date:
Subject: help with version checking
Next
From: Tom Lane
Date:
Subject: Re: help with version checking