Using PostgreSQL / pgAdminIII, is it possible to send command line commands to PostgreSQL via the UI? Put another way: how can I access the command line via the pgAdminIII?

As I am coming up to speed on pgAdminIII, occasionally it seems like it would be useful. Ex: I search for a solution to an issue, but all I find is a solution that involves the command line, not the pgAdminIII UI.


Maybe I am not understanding something more fundamental here, or maybe I am not using the proper terminology, but for example in this link Jay Taylor's answer seems to use the command line commands I am referring to: https://stackoverflow.com/questions/760210/how-do-you-create-a-read-only-user-in-postgresql

In this link Bruno's answer uses them: https://stackoverflow.com/questions/20775462/cant-grant-user-privileges-to-postgresql-database-for-a-rails-app

In this link there are several references to them: https://jamie.curle.io/creating-a-read-only-user-in-postgres

Explicitly, from the last link above, how would I send something like this to PostgreSQL/the server from pgAdminIII (not that I actually want to):

 pg_dump -O -Fc  --format=t productiondb -U backup_user -h localhost 
  • 1
    What kind of "command line solutions" are you talking about?
    – user1822
    Commented Dec 14, 2016 at 12:00
  • a_horse_with_no_name - I added some examples to my original question. Commented Dec 14, 2016 at 15:59
  • Except for pg_dump none of the examples require command line access - everything in those questions can be done using plain SQL
    – user1822
    Commented Dec 14, 2016 at 17:06
  • a_horse_with_no_name - I was pretty sure that was the case; however, my question is focused on convenience. I'd like to run these commands as-is when I find them, rather than continuing to search for the SQL only or pgAdminIII UI solution. Hopefully that makes sense. Commented Dec 14, 2016 at 17:12

1 Answer 1


If by "command line" you mean the client program psql, then the answer is no. psql is just another client program like pgAdminIII.

If you have configured File -> Options -> Browswer -> Binary paths -> PG bin path in pgAdminIII, there is a shortcut to open psql:

How to open psql from within pgAdmin

pg_dump is another separate client application. You run it from the shell of your OS. You don't "send it to Postgres". But you can optionally call it from within pgAdmin. See Tools -> Backup...

All commands starting with the shell prompt $ in Jay Taylor's answer are also commands to run in the shell. Be sure to connect to the right DB.

  • Erwin - I think this is the answer I was looking for. I added some examples to my original question. Can you confirm that your answer covers those types of commands. Sorry, can't test it because I don't have any commands to send at this time and I don't want to mess anything up. Thanks! Commented Dec 14, 2016 at 16:05
  • Erwin - Huge help! Thanks! Okay, psql is the shell you are referring to! Hadn't made that connection. Apparently some people refer to it as "shell" and some say "psql". In fact, you use both terms in your answer, but the connection is never explicitly made that they are one and the same in this case, although it is implied in your answer. I made the connection while trying to sort out what each was and found this link that links the two terms ("SQL shell (psql)"): youtube.com/watch?v=7qCTr2uzkv0 Either way, great answer, thanks! Commented Dec 14, 2016 at 17:33
  • @mountainclimber: No, psql is the name of the default PostgreSQL interactive terminal. It's a separate program you start from the shell of your OS like any other program. You can connect to Postgres DB clusters with it and send SQL and meta commands and display the response. pg_dump is another client program you run from the shell just like psql. (You cannot run it as psql command.) pgAdminIII is another program (just with a graphical interface). For convenience, you can launch psql or pg_dump from within pgAdminIII. Please follow the links to the manual in my answer. Commented Dec 15, 2016 at 3:12
  • "shell" is just a general term for "command-line interface" that some (misleadingly) also use to refer to psql. "SQL shell" or "Postgres shell" are more specific and help to disambiguate. Don't confuse that with the shell of your OS. Commented Dec 15, 2016 at 3:16
  • What shell are you referring to in your answer? Commented Dec 15, 2016 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.