Re: [ADMIN] update in rule

From: Oleg Lebedev <olebedev(at)waterford(dot)org>
To: Dmitry Morozovsky <marck(at)rinet(dot)ru>, Postgres SQL Mailing List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [ADMIN] update in rule
Date: 2001-10-18 20:40:00
Message-ID: 3BCF3E20.C010E402@waterford.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

You can use the following to install plpgsql:

CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS
'/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C';

CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler
LANCOMPILER 'PL/pgSQL';

I assume that you have default installation of postgres, otherwise change the
path in the second line.

good luck

Oleg

Dmitry Morozovsky wrote:

> On Wed, 17 Oct 2001, Stephan Szabo wrote:
>
> SS> Use a trigger instead, something like
> SS>
> SS> create function adresses_trigger() returns opaque as '
> SS> begin
> SS> NEW.date_maj := now();
> SS> return NEW;
> SS> end;' language 'plpgsql';
>
> hmm. it seems defaul pgsql installation does not contains definition for
> plpgsql language:
>
> test=# select * from pg_language ;
> lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler
> ----------+---------+--------------+---------------+-------------
> internal | f | f | 0 | n/a
> C | f | f | 0 | /bin/cc
> sql | f | f | 0 | postgres
> (3 rows)
>
> however, plpgsql.so is in pgsql lib directory (though it is *NOT* visible
> by ldconfig -r)
>
> My installation is 7.1.3 under FreeBSD 4-stable. Is it somehow my fault or
> does it need to manually do something like
>
> create function plpgsql_handler() ...
> create language 'plpgsql' ...
>
> ? Please give me advise how exactly should these statements look?
>
> Sincerely,
> D.Marck [DM5020, DM268-RIPE, DM3-RIPN]
> ------------------------------------------------------------------------
> *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck(at)rinet(dot)ru ***
> ------------------------------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jean-Michel Chabanne 2001-10-18 20:47:34 Re: PG on Suse
Previous Message Dan Langille 2001-10-18 20:02:52 Re: restricting access to stored procedures

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-10-18 22:09:54 Re: Doing a regexp-based search/replace?
Previous Message Thomas Swan 2001-10-18 19:45:10 Granting database level permissions...