Revision 1980
Added by Aaron Marcuse-Kubitza over 12 years ago
Makefile | ||
---|---|---|
145 | 145 |
postgres-: _always ; # other OSes |
146 | 146 |
|
147 | 147 |
psqlOpts := --set ON_ERROR_STOP=1 --quiet |
148 |
psqlAsAdmin := sudo -u postgres psql $(psqlOpts) |
|
148 |
psqlAsAdmin := sudo -E -u postgres psql $(psqlOpts) |
|
149 |
# -E preserves env vars so PGOPTIONS is passed to psql |
|
149 | 150 |
psqlAsBien := bin/psql_vegbien $(psqlOpts) |
150 | 151 |
bienPassword := $(shell cat config/bien_password) |
151 | 152 |
|
... | ... | |
164 | 165 |
-echo "CREATE USER bien PASSWORD '$(bienPassword)';"|$(psqlAsAdmin) |
165 | 166 |
-echo "CREATE DATABASE vegbien WITH OWNER bien TEMPLATE template0 \ |
166 | 167 |
ENCODING 'UTF8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';"|$(psqlAsAdmin) |
167 |
echo $(rmPublicSchema)|env $(psqlAsAdmin) vegbien
|
|
168 |
echo $(rmPublicSchema)|$(psqlAsAdmin) vegbien |
|
168 | 169 |
# ignore errors if user or database exists |
169 | 170 |
# drop public schema *as admin* because it starts out owned by postgres |
170 | 171 |
|
Also available in: Unified diff
main Makefile: $(psqlAsAdmin): Tell sudo to preserve env vars so PGOPTIONS is passed to psql