How to use/open psql?

25,313

You can follow this instruction

  1. Open the command prompt
  2. cd C:\postgresql-9.3.0-1-windows-x64-binaries\pgsql\bin (installed directory)
  3. Run: initdb -U postgres -A password -E utf8 -W -D POSTGRESQL_ROOT\data
  4. give super user password (Remember that)
  5. you wiil get the success message

Success. You can now start the database server using:

"postgres" -D "POSTGRESQL_ROOT\data"

or "pg_ctl" -D "POSTGRESQL_ROOT\data" -l logfile start

then, you are good to start the server

To stop the server : simply ctrl + c

You can use pgAdmin tool(http://www.postgresql.org/ftp/pgadmin3/release/v1.8.4/win32/) somewhat similar like SQL Mgt Studio

Reference : http://www.petrikainulainen.net/programming/tips-and-tricks/installing-postgresql-9-1-to-windows-7-from-the-binary-zip-distribution/

Share:
25,313
Oto Shavadze
Author by

Oto Shavadze

Updated on July 07, 2022

Comments

  • Oto Shavadze
    Oto Shavadze almost 2 years

    I have installed On windows 7 postgreSQL 9.2 version.

    Now, I need use psql, so where is this terminal?

    Can you tell me please how to use for example this comand: psql databasename ?

    Where must be type this?

    Yes, may be this is dumb question, but...

    • a_horse_with_no_name
      a_horse_with_no_name over 10 years
      You do know how to open a commandline (cmd.exe) window? "Start -> Run -> cmd.exe" then type psql databasename
  • Viji
    Viji over 10 years
    No need to reinstall, i have updated the steps, you can follow that. psql is in Mac, for Windows its pgsql