File: test_load.sh

package info (click to toggle)
libchado-perl 1.31-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 44,716 kB
  • sloc: sql: 282,721; xml: 192,553; perl: 25,524; sh: 102; python: 73; makefile: 57
file content (12 lines) | stat: -rw-r--r-- 400 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
DBHOST=$1
DBPORT=$2
DBUSER=$3
DBNAME=$4;

dropdb -h $DBHOST -p $DBPORT -U $DBUSER $DBNAME;
createdb -h $DBHOST -p $DBPORT -U $DBUSER $DBNAME;
createlang -h $DBHOST -p $DBPORT -U $DBUSER plpgsql $DBNAME;
cat modules/complete.sql | psql -h $DBHOST -p $DBPORT -U $DBUSER $DBNAME 2>&1 | grep -E 'ERROR|FATAL|No such file or directory';
echo "database $DBNAME created on $DBHOST:$DBPORT";
true;