diff options
Diffstat (limited to 'sca-cpp/trunk/components/sqldb/pgsql')
-rwxr-xr-x | sca-cpp/trunk/components/sqldb/pgsql | 12 |
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 |