Commit 6a4b97ee authored by kapsner's avatar kapsner

fixed in postgres-makefile to work with new docker installation

parent 17267153
......@@ -34,18 +34,19 @@ $(TBDIR_TARGETS):
# this rule not depend directly on $(TABLESPACES)% and instead call
# $(MAKE) $(TABLESPACES)$* at the last moment
tablespace_%:
test `$(PSQL_COMMAND) -c "select exists (select spcname from pg_tablespace where spcname = '$*')" -tA` \
test `$(PGSQL_BIN)psql -c "select exists (select spcname from pg_tablespace where spcname = '$*')" -tA` \
= 't' || { \
$(MAKE) $(TABLESPACES)$*; \
$(PSQL_COMMAND) -c "CREATE TABLESPACE $* LOCATION '$(TABLESPACES)$*'"; }
$(PGSQL_BIN)psql -c "CREATE TABLESPACE $* LOCATION '$(TABLESPACES)$*'"; }
tablespaces: $(TB_TARGETS)
createdb:
test `$(PSQL_COMMAND) -d template1 -c "select exists (select datname from pg_database where datname = '$(PGDATABASE)')" -tA` \
test `$(PGSQL_BIN)psql -d template1 -c "select exists (select datname from pg_database where datname = '$(PGDATABASE)')" -tA` \
= 'f' || (echo -e "\e[31mERROR\e[m: Database $(PGDATABASE) already exists or connection error"; false)
$(PSQL_COMMAND) -d template1 -c "CREATE DATABASE $(PGDATABASE) TEMPLATE template0 \
ENCODING='UTF-8' LC_COLLATE='en_US.UTF-8'"
$(PGSQL_BIN)createdb -T template0 -E 'UTF8' --lc-collate='en_US.UTF-8' $(PGDATABASE)
# $(PSQL_COMMAND) -d template1 -c "CREATE DATABASE $(PGDATABASE) TEMPLATE template0 \
# ENCODING='UTF-8' LC_COLLATE='en_US.UTF-8'"
# Don't depend on the SQL file, otherwise make'll try to create it
load_%:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment