2
-- contrib/sepgsql/sepgsql.sql
7
-- to set up a new database cluster.
9
-- 2. Edit $PGDATA/postgresql.conf
10
-- to add 'MODULE_PATHNAME' to shared_preload_libraries.
13
-- shared_preload_libraries = 'MODULE_PATHNAME'
15
-- 3. Run this script for each databases
16
-- This script installs corresponding functions, and assigns initial
17
-- security labels on target database objects.
18
-- It can be run both single-user mode and multi-user mode, according
19
-- to your preference.
22
-- $ for DBNAME in template0 template1 postgres; \
24
-- postgres --single -F -c exit_on_error=true -D $PGDATA $DBNAME \
25
-- < /path/to/script/sepgsql.sql > /dev/null \
28
-- 4. Start postmaster,
29
-- if you initialized the database in single-user mode.
31
LOAD 'MODULE_PATHNAME';
32
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_getcon() RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_getcon' LANGUAGE C;
33
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_mcstrans_in(text) RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_mcstrans_in' LANGUAGE C STRICT;
34
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_mcstrans_out(text) RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_mcstrans_out' LANGUAGE C STRICT;
35
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_restorecon(text) RETURNS bool AS 'MODULE_PATHNAME', 'sepgsql_restorecon' LANGUAGE C;
36
SELECT sepgsql_restorecon(NULL);