Обсуждение: Cannot upgrade to 8.4.1 on Windows

Поиск
Список
Период
Сортировка

Cannot upgrade to 8.4.1 on Windows

От
Bill Todd
Дата:
I am a PostgreSQL novice. I successfully  installed 8.3.3 on a Windows
XP Pro machine using the pgInstaller and have been using it since. Now I
want to upgrade to 8.4.1.

The only installer I can find for Windows for 8.4.1 is the One Click
installer provided by EnterpriseDB. If I attempt to run the One Click
installer while logged on as the postgresql user it fails immediately by
displaying the infamous Windows dialog that says the program has
encountered an error and must be shutdown and asking if you want  to
send a report to Microsoft or not.

Thinking that this might be a rights issue I added the postgresql user
to the Administrators  group and tried the install again. This time a
dialog appeared stating that  the Microsoft C++ RTL installer had
encountered an error. The dialog then disappeared. In both cases the
installer never reached the point of displaying its splash screen.

Next, I tried running the installation under my normal login, which is
also a member of the Administrators group, and it ran. Of course the
installation it created is unusable because PostgreSQL now runs under my
account, the postgres database does not exist, a database with my
account name was created and I am sure other things are messed up also.
Therefore I uninstalled 8.4.1 and deleted the installation directory.

Is there a complete set of instructions for installing 8.4.1 on Windows
somewhere? I have not been able to find anything using Google and the
information in the manual is  incompatible with the One Click installer.
If there is no accurate documentation can someone suggest what I am
doing wrong?  Thanks.

Bill

Re: Cannot upgrade to 8.4.1 on Windows

От
"Massa, Harald Armin"
Дата:
Hello Bill,

some words to the installation of PostgreSQL on Windows:

There are 3 user accounts involved:

a) the Administrator account (or user with Administration privilege)
- This user is running the installer. It should have Administrator privileges, because only Admins are allowed to register Services and enter the necessary registry keys.

b) the windows user account, under which PostgreSQL service will run. The default name for this account is "postgres". This is a windows user account with very limited privileges; BUT it must have the "logon as service" privilege. The PostgreSQL installers do create this account for you.
The installers also change the ownership of the PostgreSQL data folder, so that the windows user postgres can access those data files. You should never need to logon as this user.

c) the PostgreSQL superuser WITHIN the database (that's nothing with windows). Unfortunately its default name is also postgres

Your problems circle around a) and b).

First: the installer should be run as an user with Admin privs.
Second: it is not a good idea to give admin privs to the postgresql user. pg_ctl start now actively drops admin privs within its code, but it is not in good taste (and a potential source of trouble) to give admin to postgres(windows user)

To "clean up" your system I recommend the following steps (note: that is NOT the normal path of upgrade, but since you did some things you should not do...)

a) pg_dump all your databases from PostgreSQL 8.3  (or use pg_dumpall)

a1) perhaps check if those dumps are loadable, i.e. that you called pg_dump with the correct parameters to do what you want it to do, and that you dumped the databases are the ones you wanted to dump

b) store those dumpfiles well

c) make a backup-copy of the data-directory of PostgreSQL 8.3 (not necessary, just a double security measure)

d) uninstall PostgreSQL 8.3 [as admin user]

e) remove the windows user postgres (net user postgres /delete or via useradmin)

f) reboot [not strictly necessary, but I learned it helps with windows]

g) make sure that there is not postgres service running [it cannot be, as of d) and e), this is just a check that d) and e) worked]

h) install PostgreSQL 8.4.x, while logged on as a user with admin privileges

i) make sure the <programms>/postgresql/8.4/bin is added to your path

j) load your dumps from step a)

k) enjoy PostgreSQL

Again: this is not the normal way, it is advised to install PostgreSQL 8.4 "in parallel" and use the 8.4 pg_dump to export the 8.3 databases; but as there are some misinstallations on the windows level on your system, this receipt has a higher likelyhood to work.

best wishes,

Harald



--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
%s is too gigantic of an industry to bend to the whims of reality