]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/create_database.sql
Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac
[working/Evergreen.git] / Open-ILS / src / sql / Pg / create_database.sql
1 -- This file is intended to be called by eg_db_config.pl
2
3 -- If manually calling:
4 -- Connect to the postgres database initially
5 -- Specify the database to create as -vdb_name=DATABASE
6 -- Specify the postgres contrib directory as -vcontrib_dir=CONTRIBDIR
7 -- You can get the contrib directory using pg_config --sharedir and adding a /contrib to it
8
9 -- NOTE: This file does not do transactions
10 -- This is intentional. Please do not wrap in BEGIN/COMMIT.
11 DROP DATABASE IF EXISTS :db_name;
12
13 CREATE DATABASE :db_name TEMPLATE template0 ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C';
14
15 \connect :db_name
16
17 CREATE LANGUAGE plperl;
18 CREATE LANGUAGE plperlu;
19
20 -- This dance is because :variable/blah doesn't seem to work when doing \i
21 -- But it does when doing \set
22 -- So we \set to a single variable, then use that single variable with \i
23 \set load_file :contrib_dir/tablefunc.sql
24 \i :load_file
25 \set load_file :contrib_dir/tsearch2.sql
26 \i :load_file
27 \set load_file :contrib_dir/pgxml.sql
28 \i :load_file
29 \set load_file :contrib_dir/hstore.sql
30 \i :load_file