Allow SQL commands to be run against a specific DB

If resource[:db] is set, then it is sent to psql. 

Otherwise, argument is omitted and should not introduce any regression.
Merge pull request #134 from cv/patch-1

Allow SQL commands to be run against a specific DB