I added a port switch for postgresql in ob-sql.el If you have sql loaded and do something like the follow: #+name: example #+header: :engine postgresql #+header: :dbhost localhost #+header: :dbport 6543 #+header: :dbuser orgmode #+header: :database ob-sql #+BEGIN_SRC sql select * from everything #+END_SRC Note: default port for postrgres is 5432 not 6543 You will be either presented with an error or in my case a failed password prompt since I had multiple db servers running. The problem was that org-babel-sql-dbstring-postgresql did not accept a port argument. I have attached a simple patch to fix this and have verified it works for me. I would have loved to add some tests, but I ran into some problems: 1) I could not figure out how to get just one test file to run 2) I was not able get make test to load the sql language in babel Is there a recommended/standard way to resolve these problems with tests?