Problems running PostGreSQL silent install

Started by Gregover 19 years ago4 messagesgeneral
Jump to latest
#1Greg
greg@officium.co.za

I have seen many problems like this in the forum, but cannot see a solution
for mine...

I have created an account with restricted privileges for the service.
Everything works fine until I get an error running the silent install.

Failed to run initdb: 1!

I then check the logfile, and it says

The files belonging to this database system will be owned by user
"postgres2".
This user must also own the server process.

The database cluster will be initialized with locale C.

initdb: directory "C:/Program Files/PostgreSQL/8.1/data" exists but is not
empty
If you want to create a new database system, either remove or empty
the directory "C:/Program Files/PostgreSQL/8.1/data" or run initdb
with an argument other than "C:/Program Files/PostgreSQL/8.1/data".

The problem is, that I am trying to install a second instance of PostGreSQL
on another port in another location my test computer.
Is this possible?

Here is my silent install .bat script file

msiexec.exe /i postgresql-8.1-int.msi /qr INTERNALLAUNCH=1
ADDLOCAL=server,psql BASEDIR="c:\postgres" SERVICEDOMAIN="%COMPUTERNAME%"
SERVICEACCOUNT="postgres2" SERVICEPASSWORD="test" SUPERPASSWORD="o2BS#9798"
LISTENPORT=9092

#2Magnus Hagander
magnus@hagander.net
In reply to: Greg (#1)
Re: Problems running PostGreSQL silent install

initdb: directory "C:/Program Files/PostgreSQL/8.1/data"
exists but is not empty If you want to create a new database
system, either remove or empty the directory "C:/Program
Files/PostgreSQL/8.1/data" or run initdb with an argument
other than "C:/Program Files/PostgreSQL/8.1/data".

The problem is, that I am trying to install a second instance
of PostGreSQL on another port in another location my test computer.
Is this possible?

No, the MSI instlaler only lets you install once instance on each
machine. (Unless you are talking different versions, that is). You can,
however, install one instance with the MSI installer, and then manually
run initdb and pg_ctl register to set up a second service with a
different data directory.

//Magnus

#3Greg
greg@officium.co.za
In reply to: Magnus Hagander (#2)
Re: Problems running PostGreSQL silent install

Thank you for the reply.
But then are you saying I don't even really need to use the MSI in the first
place?
I can just copy the files to a folder. Then run initdb and pg_ctl?

I am bundling PostGreSQL with my software package. And will be using
Installshield to copy my program files to the client computer.
Now can I just get the PostGresql folder, put it where I want, then
Run initdb and pg_ctl?

-----Original Message-----
From: Magnus Hagander [mailto:mha@sollentuna.net]
Sent: Friday, October 27, 2006 10:22 PM
To: Greg Quinn; pgsql-novice@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: RE: [GENERAL] Problems running PostGreSQL silent install

No, the MSI instlaler only lets you install once instance on each
machine. (Unless you are talking different versions, that is). You can,
however, install one instance with the MSI installer, and then manually
run initdb and pg_ctl register to set up a second service with a
different data directory.

//Magnus

#4Magnus Hagander
magnus@hagander.net
In reply to: Greg (#3)
Re: Problems running PostGreSQL silent install

Thank you for the reply.
But then are you saying I don't even really need to use the
MSI in the first place?
I can just copy the files to a folder. Then run initdb and pg_ctl?

Sure. The MSI is just a convenient way to get everything into place, and
to set icons and stuff.

I am bundling PostGreSQL with my software package. And will
be using Installshield to copy my program files to the client
computer.
Now can I just get the PostGresql folder, put it where I
want, then Run initdb and pg_ctl?

Yes, certainly. If you just need the backend, you will just need that
and possibly set some permissions. You can look at the code to
pginstaller (http://pgfoundry.org/projects/pginstaller/) to get details
of exactly what it does. Much of the code is to deal with service
account verification and creation - if you already have this solved
elsewhere, you can probably get around things much easier.

//Magnus