/var/lib/gnumed/server/sql/gmCreateProceduralLanguages.sql is in gnumed-server 16.17-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | -- ==============================================================
-- GNUmed database schema change script
--
-- Source database version: v2
-- Target database version: v3
--
-- License: GPL v2 or later
-- Author: Karsten Hilbert
--
-- ==============================================================
-- $Id: gmCreateProceduralLanguages.sql,v 1.4 2008-07-15 15:27:05 ncq Exp $
-- $Revision: 1.4 $
-- --------------------------------------------------------------
\unset ON_ERROR_STOP
-- --------------------------------------------------------------
-- pl/pgSQL
-- 8,0+
create language 'plpgsql';
-- 7.4+
CREATE OR REPLACE FUNCTION make_plpgsql()
RETURNS bool
LANGUAGE SQL
AS '
create or replace function plpgsql_call_handler()
returns language_handler
language ''C''
as ''plpgsql'';
create trusted language "plpgsql" handler "plpgsql_call_handler";
select true;
';
SELECT CASE
WHEN (SELECT COUNT(1) > 0 FROM pg_language WHERE lanname = 'plpgsql') THEN
true
ELSE
(SELECT make_plpgsql())
END
;
drop function make_plpgsql();
drop function check_plpgsql_existence();
\set ON_ERROR_STOP 1
-- try creating a function which will fail if it doesn't exist
create function check_plpgsql_existence()
returns bool
language 'plpgsql'
as '
BEGIN
return true;
END;';
drop function check_plpgsql_existence();
-- --------------------------------------------------------------
-- don't forget appropriate grants
--grant select on forgot_to_edit_grants to group "gm-doctors";
-- ==============================================================
-- $Log: gmCreateProceduralLanguages.sql,v $
-- Revision 1.4 2008-07-15 15:27:05 ncq
-- - make us fail early if proc lang plpgsql cannot be installed
--
-- Revision 1.3 2007/04/24 17:04:08 ncq
-- - oid can be missing on later PG versions
--
-- Revision 1.2 2006/12/29 16:30:40 ncq
-- - drop helper function after use
--
-- Revision 1.1 2006/12/29 13:52:12 ncq
-- - factor out from bootstrapper proper
--
-- Revision 1.5 2006/10/24 13:09:45 ncq
-- - What it does duplicates the change log so axe it
--
|