Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install PostgreSQL on windows using command prompt? [closed]

Is there any way to install PostgreSQL on windows using command prompt?
(Without using PostgreSQL installer)

like image 656
Gaurav Chaudhary Avatar asked Mar 05 '14 09:03

Gaurav Chaudhary


People also ask

How do you check if postgres is installed Windows using CMD?

The quick way to verify the installation is through the psql program. First, click the psql application to launch it. The psql command-line program will display. Second, enter all the necessary information such as the server, database, port, username, and password.

How do I get out of PostgreSQL command prompt?

Type \q and then press ENTER to quit psql . As of PostgreSQL 11, the keywords " quit " and " exit " in the PostgreSQL command-line interface have been included to help make it easier to leave the command-line tool.


2 Answers

postgresql-9.3.3-1-windows-x64.exe --unattendedmodeui minimal --mode unattended --superpassword "password" --servicename "postgreSQL"
--servicepassword "password" --serverport 5432

Worth mentioning postgresql-9.3.3-1-windows-x64.exe --help will provide list of options and defaults which can be used.

like image 139
Gaurav Chaudhary Avatar answered Oct 17 '22 07:10

Gaurav Chaudhary


Run the installer in unattended(silent) mode

-or-

download the plain binaries, initdb a new datadir, then start the server with pg_ctl. You can install a service with standard Windows tools like sc or can use pg_ctl register to create the service.

If you plan to bundle PostgreSQL in an application, please use the latter method (binary zip), and make sure you run it on a port other than the default port 5432 so your app doesn't conflict with any install the user might do themselves.

like image 25
Craig Ringer Avatar answered Oct 17 '22 08:10

Craig Ringer