Skip to content

Commit 5b65252

Browse files
author
Rafa de la Torre
committed
Ensure no connection pgbouncer -> test_db #521
This is needed to make the setup a little bit more robust: when trying to delete the test database, it won't be able if there are "idle sessions" in the db (that is, connections from pgbouncer to the test database). Otherwise it fails when trying to create the database, because there's already one with the same name.
1 parent 20d1db7 commit 5b65252

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/prepare_db.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ if test x"$PREPARE_PGSQL" = xyes; then
7070

7171
echo "preparing postgres..."
7272
echo "PostgreSQL server version: `psql -A -t -c 'select version()'`"
73+
echo "PAUSE; RESUME;" | psql -p 6432 pgbouncer # make sure there are no connections pgbouncer -> test_db
7374
dropdb ${TEST_DB} # 2> /dev/null # error expected if doesn't exist, but not otherwise
7475
createdb -Ttemplate_postgis -EUTF8 ${TEST_DB} || die "Could not create test database"
7576
psql -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' ${TEST_DB}

0 commit comments

Comments
 (0)