Command open postgresql in from cmd in windows

18 views
Skip to first unread message

sunday honesty

unread,
May 30, 2020, 1:20:09 PM5/30/20
to Django users
I have been in a message before I could successfully install postgresql on my windows; it seems everyone is using Linux or Mac.

Pls can someone help me now...
I want to open postgres she'll from my command prompt so I can continue what am learning... The Tutorial am following is using Linux and the command to "psql" to open shell is not working on my windows.

Anybody please.

Jorge Gimeno

unread,
May 30, 2020, 1:40:05 PM5/30/20
to django...@googlegroups.com
Postgres on Windows may have a different story and user interface.  You may need to use something like pAdmin to work with it.

-Jorge

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e2396f7b-9e27-442d-a2aa-302a089bead8%40googlegroups.com.

Samuel Nogueira

unread,
May 30, 2020, 1:40:16 PM5/30/20
to django...@googlegroups.com

Set path For PostgreSQL in Windows:

 

  1. Searching for env will show Edit environment variables for your account
  2. Select Environment Variables
  1. From the System Variables box click new(to add new path)

 

Include the bin directory of your PostgreSQL installation. then add new path there....

[for example]

C:\Program Files\PostgreSQL\12\bin

After that click OK and then try to type psql in your command shell

 

I adapted this from a comment in stackoverflow in the link bellow, if it doesnt work I suggest you to go there.

https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools

--

sunday honesty

unread,
May 30, 2020, 2:19:01 PM5/30/20
to django...@googlegroups.com
@Samuel,
I did that and psql now opened and prompted me to enter password for my user name(system). I entered the password I created while installing postgresql and got a fatal error even when I was connected to the internet...

PS: the username it gave me during installation is postgres but prompted me to enter password for my computer username

Samuel Nogueira

unread,
May 30, 2020, 5:18:00 PM5/30/20
to django...@googlegroups.com

Can you send  me more details about the error? A screenshot should be enough

sunday honesty

unread,
May 30, 2020, 5:29:26 PM5/30/20
to django...@googlegroups.com
Here is the screenshot... Pls download.

PS: I was connected to the internet and also tried it without internet connection.

psql.PNG

Samuel Nogueira

unread,
May 30, 2020, 5:45:18 PM5/30/20
to django...@googlegroups.com

Sorry but i think your screenshot wasn’t attached to your last email, please end it again

sunday honesty

unread,
May 30, 2020, 5:48:29 PM5/30/20
to django...@googlegroups.com
Here is it again

psql.PNG

Samuel Nogueira

unread,
May 30, 2020, 6:34:45 PM5/30/20
to django...@googlegroups.com
you just need to specify the username wich you want to use. So type "psql -U postgres", as postgres being your username.


sunday honesty

unread,
May 31, 2020, 2:39:57 AM5/31/20
to django...@googlegroups.com
All right. I'll do that now.

sunday honesty

unread,
May 31, 2020, 5:20:47 AM5/31/20
to django...@googlegroups.com
It worked Samuel. Thank you very much

Samuel Nogueira

unread,
May 31, 2020, 7:27:12 AM5/31/20
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages