Check if language is installed

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Check if language is installed
Date: 2007-07-06 14:38:50
Message-ID: f6lkd2$2m8d$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

My script running as superuser needs to install plpgsql using

CREATE LANGUAGE plpgsql;

in 8.2+

Which is the best way to check that this command does not cause error ?

Is it best to use

select true from pg_language where lanname='plpgsql'

for checking for plpgsql existance before running CREATE LANGUAGE ?

Andrus.

Browse pgsql-general by date

  From Date Subject
Next Message Sibte Abbas 2007-07-06 15:04:46 Re: DB crashed and duplicated template0 db
Previous Message Andreas 'ads' Scherbaum 2007-07-06 14:10:50 Re: Problem with autovacuum and pg_autovacuum