piped target added for multiple select
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Tue, 1 Mar 2011 04:48:34 +0000 (05:48 +0100)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Tue, 1 Mar 2011 04:48:34 +0000 (05:48 +0100)
sql/builder.sh

index cdb8a31..74e009c 100755 (executable)
@@ -62,7 +62,9 @@ elif [ "$1" = "rebuild" ]; then
       echo "-- MESG: build start" ; one_or_all $2 | grep -iv '^drop' ; echo "-- MESG: build end" ;   ) \
         | sqlexe $sht
 elif [ "$1" = "psql" ]; then
-   psql -h $DBHOST -U $DBUSER $DBBASE
+   psql -h $DBHOST -U $DBUSER $DBBASE $@
+elif [ "$1" = "piped" ]; then
+   psql -h $DBHOST -U $DBUSER $DBBASE -t -q -A -F '|' $@
 elif [ "$1" = "dump" ]; then
    if [ $# -eq 1 ]; then
       pg_dump -a --inserts -h $DBHOST -U $DBUSER $DBBASE
@@ -85,6 +87,7 @@ else
     echo "   ./builder build"
     echo "   ./builder rebuild"
     echo "   ./builder psql"
+    echo "   ./builder piped"
     echo "   ./builder add <filesql>"
     echo "   ./builder dump [dumpfile]"
     echo "   ./builder dumpall [dumpfile]"