Fix assorted bugs in ecpg's macro mechanism.
[pgsql.git] / contrib / sepgsql / sepgsql.sql.in
blob917d12dbbedc851b00d8a54506e412358b13dec1
1 --
2 -- contrib/sepgsql/sepgsql.sql
3 --
4 -- [Step to install]
5 --
6 -- 1. Run initdb
7 -- to set up a new database cluster.
8 --
9 -- 2. Edit $PGDATA/postgresql.conf
10 -- to add 'MODULE_PATHNAME' to shared_preload_libraries.
12 -- Example)
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.
21 -- Example)
22 -- $ for DBNAME in template0 template1 postgres; \
23 -- do \
24 -- postgres --single -F -c exit_on_error=true -D $PGDATA $DBNAME \
25 -- < /path/to/script/sepgsql.sql > /dev/null \
26 -- done
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_setcon(text) RETURNS bool AS 'MODULE_PATHNAME', 'sepgsql_setcon' LANGUAGE C;
34 CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_mcstrans_in(text) RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_mcstrans_in' LANGUAGE C STRICT;
35 CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_mcstrans_out(text) RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_mcstrans_out' LANGUAGE C STRICT;
36 CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_restorecon(text) RETURNS bool AS 'MODULE_PATHNAME', 'sepgsql_restorecon' LANGUAGE C;
37 SELECT sepgsql_restorecon(NULL);