Postgresql Command Line Select From Multiple Tables