blob: c1c2482f3b25105e53c1e25268046d0a15089713 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#! /usr/bin/env bash
# file : build/pgsql/pgsql
# author : Constantin Michael <constantin@codesynthesis.com>
# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
# license : GNU GPL v2; see accompanying LICENSE file
#
# PostgreSQL driver wrapper.
#
while [ $# -gt 0 ]; do
case $1 in
--driver)
driver=$2
shift 2
;;
--user)
opt="$opt --user=$2"
shift 2
;;
--database)
opt="$opt --dbname=$2"
shift 2
;;
--host)
opt="$opt --host=$2"
shift 2
;;
--port)
opt="$opt --port=$2"
shift 2
;;
*)
break
;;
esac
done
if [ -z "$driver" ]; then
driver=psql
fi
opt="--quiet $opt"
export PGOPTIONS=--client-min-messages=warning
if [ -n "$1" ]; then
exec $driver $opt <$1
else
exec $driver $opt
fi
|