~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/test/bench/create.sh

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# $PostgreSQL$
 
3
 
4
if [ ! -d $1 ]; then
 
5
        echo " you must specify a valid data directory " >&2
 
6
        exit
 
7
fi
 
8
if [ -d ./obj ]; then
 
9
        cd ./obj
 
10
fi
 
11
 
 
12
echo =============== destroying old bench database... =================
 
13
echo "drop database bench" | postgres -D"$1" postgres > /dev/null
 
14
 
 
15
echo =============== creating new bench database... =================
 
16
echo "create database bench" | postgres -D"$1" postgres > /dev/null
 
17
if [ $? -ne 0 ]; then
 
18
        echo createdb failed
 
19
        exit 1
 
20
fi
 
21
 
 
22
postgres -D${1} bench < create.sql > /dev/null
 
23
if [ $? -ne 0 ]; then
 
24
        echo initial database load failed
 
25
        exit 1
 
26
fi
 
27
 
 
28
exit 0