run sql/queries (postgres) within bash

e.g.

for things-to-buy in $(psql -d database-name -U username -c “select item from glossaries where priority = ‘urgent’ “;

do

blah, blah, blah …

done

One Response to “run sql/queries (postgres) within bash”

  1. spoonfork Says:

    you can also do the following:

    echo “select * from cibailanjio” | mysql -uroot -p

Leave a Reply