Re: Locallhost Windows installation

From: "Andy Shellam" <andy(dot)shellam(at)mailnetwork(dot)co(dot)uk>
To: "'System Consult'" <systemconsult(at)gmail(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Locallhost Windows installation
Date: 2006-05-09 11:42:18
Message-ID: 20060509114214.674AF9F931D@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> however, now that i have installed not as a service, how do i correct it?

If this is a new installation and you've not loaded any data yet, I'd say
the easiest way would be to uninstall and re-install it again (it would also
give you chance to double-check where the data directory is for reference,
although you don't particularly need to know this (except maybe for
file-system-level backups.)

> since i intend to use this with java applications which are going to be
distributed, does one need to activate the server in order to access the
database too or one can access the database directly.

All SQL transactions go through the PostgreSQL server - on Windows this is
using an ODBC / OLE DB driver. You will never be able to read the data out
of the flat files, so yes you need PostgreSQL to be running to access it
(hence the best approach is to leave the service to start automatically, so
if the server reboots, PostgreSQL will be already running again.)

All connections go through port 5432 (the default) so make sure this is
opened up on your firewall (on Windows 2003 R2 or XP SP2 don't forget to
check the Windows Firewall.)

If your Java apps accessing PostgreSQL go through TCP/IP (i.e. they sit on
client machines on a LAN and talk back to the server), you will need to edit
your pg_hba.conf file (access through the Start menu > Programs >
PostgreSQL). And add a line like (under # IPv4.)

host user database 192.168.1.0/24 md5

Replace "user" with your Java apps connection user (or you can set it to
"all" to allow any user access)

Replace "database" with the database name of your app (or you can set it to
"all" to allow any access to any database)

Replace 192.168.1.0/24 with your network's IP range (or if you don't want to
restrict to any particular network, use 0.0.0.0/0.)

Md5 is the authentication method - you can set to "trust" instead of md5 to
allow any connection without a password being required (this should be
restricted to the localhost (127.0.0.1/32) only, or at worst, your local
network for obvious security reasons). However md5 states that a valid
password must be required to connect. I believe you can use crypt as well.

Well done on choosing PostgreSQL! I'm sure when you get up and running to
know the system you'll be glad of the choice you made.

Andy

PS. Don't forget to CC the mailing list into your responses so others can
follow the conversation.

_____

From: System Consult [mailto:systemconsult(at)gmail(dot)com]
Sent: 09 May 2006 12:27 pm
To: andy(dot)shellam(at)mailnetwork(dot)co(dot)uk
Subject: Re: [ADMIN] Locallhost Windows installation

thanks a million for this enlightenment. however, now that i have installed
not as a service, how do i correct it? then, since i intend to use this with
java applications which are going to be distributed, does one need to
activate the server in order to access the database too or one can access
the database directly.

thanks upfront

On 09/05/06, Andy Shellam <andy(dot)shellam(at)mailnetwork(dot)co(dot)uk> wrote:

You should ideally install it as a Windows service. You can restrict access
to the server using the pg_hba.conf to the local machine only so other
network machines cannot connect. The windows service means that PostgreSQL
can be controlled automatically at startup, rather than have to be started
manually.

You define the data directory in the MSI installer (although I believe this
is my default under C:\Program Files\PostgreSQL\Data.)

To use the database, you need a management program, such as PgAdmin III -
this ships with the MSI installer, if you install this at the same time as
you install Postgres, it'll add a connection to PgAdmin for the local
server.

The latest version manual can be found on the documentation website -
that'll give you any information you need regarding config files etc.

Andy

_____

From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of System Consult
Sent: 09 May 2006 10:47 am
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] Locallhost Windows installation

Im a new user, having read so much about the database.

i installed the binary version successfuly on windows. I did not install as
a service, as all access have to be through the local host, via a
program(java). Now how do i create the database at a specified directory and
start using this.

kind and urgent assistance required

!DSPAM:14,44607c8c34491598092421!

Browse pgsql-admin by date

  From Date Subject
Next Message System Consult 2006-05-09 13:01:30 Re: Locallhost Windows installation
Previous Message Andy Shellam 2006-05-09 09:54:41 Re: Locallhost Windows installation