Sunday, March 13, 2011

Installing PostgreSQL 9.0 on Windows (Vista)

Installed PostgreSQL Version 9.0.3-1 on Windows. There seems to be only one way to install PostgreSQL 9.0 on Windows; that is using one-click installer provided by EnterpriseDB

1. Download installer.
I downloaded from http://www.enterprisedb.com/products-services-training/pgdownload#windows.

2. Execute installer.
Double click: postgresql-9.0.3-1-windows_x64.exe

3. Options.
I did not select any extra items.

4. Only information needed for installation was to provide a password for root user: postgres.

5. Installed PostgreSQL directory
It was installed in C:\Program Files\PostgeSQL\9.0\

6. Startup Menu
The startup menu includs:pgAdmin III, and a batch file (runpsql.bat, "SQL Shell") to launch psql.
The content of this batch file is as follows.
@echo off

REM PostgreSQL server psql runner script for Windows
REM Dave Page, EnterpriseDB

SET server=localhost
SET /P server="Server [%server%]: "

SET database=postgres
SET /P database="Database [%database%]: "

SET port=5433
SET /P port="Port [%port%]: "

SET username=postgres
SET /P username="Username [%username%]: "

for /f "delims=" %%a in ('chcp ^|find /c "932"') do @ SET CLIENTENCODING_JP=%%a
if "%CLIENTENCODING_JP%"=="1" SET PGCLIENTENCODING=SJIS
if "%CLIENTENCODING_JP%"=="1" SET /P PGCLIENTENCODING="Client Encoding [%PGCLIENTENCODING%]: "

REM Run psql
"C:\Program Files\PostgreSQL\9.0\bin\psql.exe" -h %server% -U %username% -d %database% -p %port%

pause

7. Viewing installed PostgreSQL 9.0 from pgAdmin III.


8. You can stop/start the server from Services control panel

No comments:

Post a Comment