summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/components/sqldb/pgsql
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/components/sqldb/pgsql')
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql12
1 files changed, 11 insertions, 1 deletions
diff --git a/sca-cpp/trunk/components/sqldb/pgsql b/sca-cpp/trunk/components/sqldb/pgsql
index 3cd1904e32..dab30e642b 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql
+++ b/sca-cpp/trunk/components/sqldb/pgsql
@@ -21,5 +21,15 @@
here=`readlink -f $0`; here=`dirname $here`
pgsql_prefix=`cat $here/pgsql.prefix`
-$pgsql_prefix/bin/psql -c "$1" db
+if [ "$2" = "" ]; then
+ host="localhost"
+ port="5432"
+ cmd="$1"
+else
+ host="$1"
+ port="$2"
+ cmd="$3"
+fi
+
+$pgsql_prefix/bin/psql -h $host -p $port -c "$cmd" db