~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

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

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# $PostgreSQL: pgsql/src/test/bench/create.sh,v 1.4 2004-09-01 17:25:40 tgl Exp $
 
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} template1 > /dev/null
 
14
 
 
15
echo =============== creating new bench database... =================
 
16
echo "create database bench" | postgres -D${1} template1 > /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