spejstore-new/postgres-hstore/create_extension.sh

13 lines
476 B
Bash
Raw Normal View History

2017-02-15 03:01:47 +00:00
# Because both template1 and the user postgres database have already been created,
# we need to create the hstore extension in template1 and then recreate the postgres database.
#
# Running CREATE EXTENSION in both template1 and postgres can lead to
# the extensions having different eid's.
2017-05-09 23:22:56 +00:00
psql --dbname template1 <<EOSQL
2017-02-15 03:01:47 +00:00
CREATE EXTENSION hstore;
CREATE EXTENSION ltree;
DROP DATABASE $POSTGRES_USER;
CREATE DATABASE $POSTGRES_USER TEMPLATE template1;
EOSQL