Thread: Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!!

Hi Folks/Alvaro/George Weaver/Sachin Kotwal

 

<<< PLEASE CAN SOMEONE HELP ME!! >>>

 

Apologies for ‘shouting’: I have been trying since 21st June to get someone to help me, since my initial post using the bug reporting form which has still been ignored. I am just trying to get started with Postgres and cannot get anywhere with it, as it is refusing to install. I need someone to please look at my error log which I posted nearly six weeks ago, and tell me what is wrong.

 

George’s suggestion that I worry about getting Postgres to install correctly is EXACTLY THE PROBLEM I HAVE!! I can’t work why it will not do so. I have tried re-naming the folder afterwards to sort the data as he has suggested, but as I mentioned the install is failing near the end, as shown in the log...WHY???

 

Sachin has said that I have not performed my uninstall correctly. What have I done wrong?? Please tell me as I have no idea. Simply telling me ‘I have done it wrong’ does not help. Obviously I have tried to do it right. I have repeatedly uninstalled and re-installed over and over and over again, and still I get the same result!! I have uninstalled by going into Windows Control Panel, selecting Postgres and the Uninstall option, which is the usual way to remove Windows programs, unless there is a specific Uninstall utility. If I am supposed to remove a hidden Windows user, I have no idea how to do this.

 

Please can someone:

1.       Explain why my bug report has not been responded to

2.       Say what the attached file and email character limits actually are, and why they are so low

3.       Look at the attached log file

4.       Tell me what is wrong –or make some suggestions/how to find out

5.       Tell me how I should uninstall Postgres, if I am doing this wrong

6.       Tell me how to remove any hidden users or how I should reset/remove directories etc.

7.       Give some general guidance on how to fix the problem.

 

Apologies for moaning to everyone –I do appreciate your help- but I have been waiting a long time and CANNOT GET ANYWHERE WITH POSTGRESQL!! (which I think should be brilliant).

 

Many thanks

  Stephen Brearley

 

Original problem:

 

On re-installing Postgres, I have not been able to get it to work. During re-installation I get an error message saying the program exited with an error code, but otherwise appears to be okay. However, when I go into pgadmin and enter my password to connect to the server (any password gives the same response), I get a popup saying ‘Server doesn’t listen’, could not connect, connection refused etc’. The setup defaults to port 5432 during the install process. I’ve checked postgresql.conf which has not been installed, but I’ve looked at an old copy that I moved into the data folder, and that looks at port 5432.

 

Postgres was working okay before, so I don’t think it’s a problem with my system or firewall, as I have not changed anything. After my initial install, I edited the registry to point to the D: drive, as I prefer to have my data stored on a separate partition, and this worked okay. The uninstall leaves the data folder intact, and appears to leave the old service password in case other services use it. Consequently it will not allow me access to pg.log, even with administrator privileges, only by using pgadmin. The Postgres install will not install with a data folder that is not empty, so I had to re-name my data folder to data_old, and moved the contents back in afterwards. The registry seems to be pointing to the right place to find my data.

 

From the install log (as attached), I see Postgres complains that loadmodules.vbs and adminpack did not install correctly. When I inspected the adminpack directory it was empty, but I’m thinking that there could be something else wrong. On my latest attempt to re-install, I don’t seem to be able to get anywhere with pgadmin, as when I try to connect I get a fatal password authentication error now.

 

The main difficulty seems to be trying to re-install Postgres. If you already have created a database, the install program balks at having a data folder that is not empty, causing me to use the above workaround to copy back my data afterwards. Should be able to do this!

 

Thanks

  Stephen

 

Attachment
On 07/29/2013 12:23 PM, Stephen Brearley wrote:
> Hi Folks/Alvaro/George Weaver/Sachin Kotwal
>
> <<< PLEASE CAN SOMEONE HELP ME!! >>>

To start the process and catch up any one not following the first time,
some questions:

1) Exactly what are you installing i.e the one click installer from EDB ?

2) When you reinstalled did you change versions(say 9.2 --> 9.2)?

3) When you do the install and get the connect error does the Process
Manager show Postgres running?

4) What is in your pg_hba.conf file?





--
Adrian Klaver
adrian.klaver@gmail.comT


Stephen Brearley wrote on 29.07.2013 21:23:
> 1.Explain why my bug report has not been responded to

Because it's not a bug as you simply upgraded incorrectly.

> 5.Tell me how I should uninstall Postgres, if I am doing this wrong

You did run the "Uninstall", did you?

> 6.Tell me how to remove any hidden users or how I should reset/remove directories etc.

There are no hidden users - especially not with 9.2 (previous versions did create a new Windows user, but that is not
thecase with 9.2). Unfortunately you failed to mention from which version you upgraded. 

> On re-installing Postgres, I have not been able to get it to work.
> During re-installation I get an error message saying the program
> exited with an error code, but otherwise appears to be okay. However,
> when I go into pgadmin and enter my password to connect to the server
> (any password gives the same response), I get a popup saying ‘Server
> doesn’t listen’, could not connect, connection refused etc’. The
> setup defaults to port 5432 during the install process. I’ve checked
> postgresql.conf which has not been installed, but I’ve looked at an
> old copy that I moved into the data folder, and that looks at port
> 5432.

And did you verify that Postgres was actually running (e.g. by looking into the taskmanager)

> Postgres was working okay before, so I don’t think it’s a problem
> with my system or firewall, as I have not changed anything. After my
> initial install, I edited the registry to point to the D: drive, as I
> prefer to have my data stored on a separate partition, and this
> worked okay.

What exactly did you "edit in the registry"? You shouldn't normally need to do that if you ran initdb correctly.

> Consequently it will not allow me access to pg.log

What is "pg.log"?

> The Postgres install will not install with a data folder that is not empty,
>so I had to re-name my data folder to data_old, and moved the contents back in
> afterwards.

What was the version before? If you upgrade from a major version to another (e.g. from 9.1 to 9.2) you can't just
"copy"the data folder. You need to migrate it using pg_upgrade (which requires the old server to be still installed) or
youneed to use pg_dump and pg_restore to get the data from the old install into the new one. 

This is clearly documented in the manual.
http://www.postgresql.org/docs/current/static/upgrading.html

> The registry seems to be pointing to the right place to find my data.

Again it should not be necessary to edit anything in the registry.
If you need to change the Windows service (which I assume you tried to do with hacking the registry) you should use
pg_ctlfor that. 


> I don’t seem to be able to get anywhere with pgadmin, as
> when I try to connect I get a fatal password authentication error
> now.

Which means the server *is* running, you simply supplied the wrong password.

> pgadmin.log
> 2013-07-18 11:17:56 ERROR  : Error connecting to the server: FATAL:  password authentication failed for user "SDB"

That is not the logfile from your installation, it's a "normal" message from pgadmin that the password supplied for the
userSDB was wrong. That has nothing to do with re-installing Postgres and clearly nothing with the "hidden" users you
werereferring to. 

So apparently your new version **is** running correctly, you just have the wrong credentials.

> The main difficulty seems to be trying to re-install Postgres. If you
> already have created a database, the install program balks at having
> a data folder that is not empty, causing me to use the above
> workaround to copy back my data afterwards. Should be able to do
> this!

Again: the upgrade process is clearly documented in the manual.


Thomas


On 07/29/2013 12:41 PM, Adrian Klaver wrote:
> On 07/29/2013 12:23 PM, Stephen Brearley wrote:
>> Hi Folks/Alvaro/George Weaver/Sachin Kotwal
>>
>> <<< PLEASE CAN SOMEONE HELP ME!! >>>
>
> To start the process and catch up any one not following the first time,
> some questions:
>
> 1) Exactly what are you installing i.e the one click installer from EDB ?
>
> 2) When you reinstalled did you change versions(say 9.2 --> 9.2)?
                    Oops meant 9.1 --> 9.2
>
> 3) When you do the install and get the connect error does the Process
> Manager show Postgres running?
>
> 4) What is in your pg_hba.conf file?
>
>
>
>
>


--
Adrian Klaver
adrian.klaver@gmail.com


----- Original Message -----
From: Stephen Brearley

<SNIP>

>I need someone to please look at my error log which I posted nearly six
>weeks ago, and tell me what is wrong.

Are you trying to tell us how to help you?  Or are you looking for help?

Since my e-mail suggesting that you work to get PostgreSQL to install
cleanly, did you:

    1. Unistall PostrgreSQL?  If so how?
    2. Remove all traces of PostgreSQL from the registry?
    3. Remove the Windows postgres user?
    4. Rename your current data directory to something other than

         - C:\Program Files\PostgreSQL\9.2\data
         - C:\ProgramData\PostgreSQL\9.2\data

    5. Having completed the above, try using the installer from
http://www.enterprisedb.com/postgresql-924-installers-win64?ls=Crossover&type=Crossover
        to re-install PostgreSQL?

If you did all of the above, what happened?

<SNIP>

George






Hi Adrian

Thanks for getting back to me so soon!

1) Yes, I downloaded postgresql-9.2.4-1-windows.exe one click installer from
the EDB web page. I see the page format has changed a little recently, but
it is still the same file.
2) No, I have only ever tried to installed version 9.2
3) Yes -though there were errors reported in the install log, which I did
not get the first time I installed the program. The first time I installed
Postgresql, I got it to work and connect okay even in pgAdmin III. A bit
later, I forgot the password as I was using Navicat which remembers your
password, so I tried to re-install it (then remembering the password of
course!), but could not get a successful reinstall or re-connection using
pgAdmin.
4) Attached is the only pg_hba.conf file I seem to have.
Checked for this file in:
C:\Program Files\PostgreSQL\9.2.
C:\Users\SDB\AppData\Local\Temp

-Maybe I should have a pg_hba.conf that is not a sample file?

Also, do you think there us something wrong with my uninstall, such as not
removing files or hidden windows users properly? I do not know how to remove
these. I just went to Control Panel, Programs and Features, selected
Postgresql and Uninstall.

Both the install and uninstall should work flawlessly. The only thing I can
see is that I have installed the program once before, and I have put my data
on my d: drive to separate it from the program in case of software problems,
but I got Postgresql to correctly find my data before..

Thanks
  Stephen

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: 29 July 2013 21:54
To: Stephen Brearley
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400,
re-installation failure PLEASE CAN SOMEONE HELP!!

On 07/29/2013 12:41 PM, Adrian Klaver wrote:
> On 07/29/2013 12:23 PM, Stephen Brearley wrote:
>> Hi Folks/Alvaro/George Weaver/Sachin Kotwal
>>
>> <<< PLEASE CAN SOMEONE HELP ME!! >>>
>
> To start the process and catch up any one not following the first
> time, some questions:
>
> 1) Exactly what are you installing i.e the one click installer from EDB ?
>
> 2) When you reinstalled did you change versions(say 9.2 --> 9.2)?
                    Oops meant 9.1 --> 9.2
>
> 3) When you do the install and get the connect error does the Process
> Manager show Postgres running?
>
> 4) What is in your pg_hba.conf file?
>
>
>
>
>


--
Adrian Klaver
adrian.klaver@gmail.com

Attachment
On Jul 31, 2013, at 12:07, "Stephen Brearley" <mail@stephenbrearley.name> wrote:

> Both the install and uninstall should work flawlessly. The only thing I can
> see is that I have installed the program once before, and I have put my data
> on my d: drive to separate it from the program in case of software problems,
> but I got Postgresql to correctly find my data before..


If Postgres is having any issues starting up, details should be in the log file. I don't know where that file gets
writtenon a Windows system though, perhaps it ends up in the Windows Event log? 

What procedure did you follow to move your data to the D-drive? That seems a likely cause of trouble, especially if the
databasewas running while you did that - you may be looking at an unrecoverable database snapshot if you didn't take
precautions,in which case the database would refuse to start up. 

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



Hi Thomas

 

**Thanks for getting back to me**

 

In answer to your points:

 

1)      I could not get Postgresql to run correctly, so I assumed it could be a bug. I checked the documentation for bug reports, and this seemed to suggest that anything that appears to be a bug should be reported. If a decision is made that this is not a bug, it would be helpful if someone sent a short message to say so, and tell me to report my problem elsewhere. Otherwise I just sit there waiting and nothing happens!!

 

5) There does not appear to be a specific ‘Uninstall’ option on the Windows Start menu, so I went to Control Panel, Programs and features, PostgreSQL 9.2 Uninstall/Change option. Is this correct?

 

6) I have not performed an upgrade of Postgres. Inititially, I had no Postgres, then I installed postgresql-9.2.4-1-windows.exe, then I forgot my password as was using Navicat that remembers it automatically and tried to use pgAdmin which doesn’t, so I tried to reinstall (then of course remembered my password!). I have not been able to get Postgres to work correctly/connect since.

 

-Thank-you for confirming there are no hidden users –I spent many web searches trying to work out how to remove/reset these (whew)!!

 

No, I did not verify that Postgres was running, but have since checked in the Task Manager and it is running when I fire up pgAdmin. However, I should not get any error message during the install process, and to me this clearly suggests something is wrong, as the log I attached shows. Any ideas what is wrong please?

 

I would not normally do anything in the Registry, as I am aware that is asking for trouble. However, I hadn’t noted that I could specify a data location on my original install, so I checked the web and this appeared to be the only way to do this for some programs. I edited PostgreSQL|Installations|postgresql-9.2|Data Directory and changed the default from the C: drive to my folder on the D: drive as D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data. This worked fine until I had the password problems I mentioned above, and tried to do a reinstall, so I don’t think this registry edit is causing the problem. I have only recently found the postgresql.conf option on pgAdmin.

 

Where/what is init.db? I don’t have any instructions for this file. Not sure what you mean.

 

I too am now puzzled about pg.log. I think I believed this was related to ‘hidden’ Windows users which you say are not now used, so please disregard this point now.

 

I realise that new versions of Postgres go into a different file system on the C: drive, and that I can’t just move the system files across or rename directories. However, in this case I am trying to reinstall exactly the same version, so everything should be the same, so surely it should be okay to move my old data out of the way, remove the folder it was in, perform the reinstall and move the data back? Maybe it isn’t. I was not aware of this pg_dump/pg_restore, as these instructions are intended for upgrades, which of course I would not have read, as I am trying to perform a reinstall of the same version. Therefore I will try to perform a dump, then I guess remove all my Postgres folders in D:, then reinstall Postgres and run pg_restore to bring everything back in (though this doesn’t explain the errors in the installation log).

 

Regarding the password, I have typed in the same password which I used everytime I tried to install Postgres, so I started to think there was an install problem as listed in the installation log. The installation process paused with a popup error message which I did not have the first time I installed Postgres, and the log file indicates a return code other that ‘0’ near the end, so there is a problem there. Are there any restrictions on characters that can be used in passwords? I used a ‘complex’ password selecting one character from: # - < > ? @ \ /. If I entered the wrong password several times and performed a reinstall, does Postgres continue to lock me out after so many attempts, even if I perform a reinstall? Could this be the problem, and if so, how do I get around it?

 

Apologies this is a long response, but you have raised a number of important points.

 

Many thanks

  Stephen

 

*********************************************************************************

Stephen Brearley wrote on 29.07.2013 21:23:

> 1.Explain why my bug report has not been responded to

 

Because it's not a bug as you simply upgraded incorrectly.

 

> 5.Tell me how I should uninstall Postgres, if I am doing this wrong

 

You did run the "Uninstall", did you?

 

> 6.Tell me how to remove any hidden users or how I should reset/remove directories etc.

 

There are no hidden users - especially not with 9.2 (previous versions did create a new Windows user, but that is not the case with 9.2). Unfortunately you failed to mention from which version you upgraded.

 

> On re-installing Postgres, I have not been able to get it to work.

> During re-installation I get an error message saying the program

> exited with an error code, but otherwise appears to be okay. However,

> when I go into pgadmin and enter my password to connect to the server

> (any password gives the same response), I get a popup saying ‘Server

> doesn’t listen’, could not connect, connection refused etc’. The

> setup defaults to port 5432 during the install process. I’ve checked

> postgresql.conf which has not been installed, but I’ve looked at an

> old copy that I moved into the data folder, and that looks at port

> 5432.

 

And did you verify that Postgres was actually running (e.g. by looking into the taskmanager)

 

> Postgres was working okay before, so I don’t think it’s a problem

> with my system or firewall, as I have not changed anything. After my

> initial install, I edited the registry to point to the D: drive, as I

> prefer to have my data stored on a separate partition, and this

> worked okay.

 

What exactly did you "edit in the registry"? You shouldn't normally need to do that if you ran initdb correctly.

 

> Consequently it will not allow me access to pg.log

 

What is "pg.log"?

 

> The Postgres install will not install with a data folder that is not empty,

>so I had to re-name my data folder to data_old, and moved the contents back in

> afterwards.

 

What was the version before? If you upgrade from a major version to another (e.g. from 9.1 to 9.2) you can't just "copy" the data folder. You need to migrate it using pg_upgrade (which requires the old server to be still installed) or you need to use pg_dump and pg_restore to get the data from the old install into the new one.

 

This is clearly documented in the manual.

http://www.postgresql.org/docs/current/static/upgrading.html

 

> The registry seems to be pointing to the right place to find my data.

 

Again it should not be necessary to edit anything in the registry.

If you need to change the Windows service (which I assume you tried to do with hacking the registry) you should use pg_ctl for that.

 

 

> I don’t seem to be able to get anywhere with pgadmin, as

> when I try to connect I get a fatal password authentication error

> now.

 

Which means the server *is* running, you simply supplied the wrong password.

 

> pgadmin.log

> 2013-07-18 11:17:56 ERROR  : Error connecting to the server: FATAL:  password authentication failed for user "SDB"

 

That is not the logfile from your installation, it's a "normal" message from pgadmin that the password supplied for the user SDB was wrong. That has nothing to do with re-installing Postgres and clearly nothing with the "hidden" users you were referring to.

 

So apparently your new version **is** running correctly, you just have the wrong credentials.

 

> The main difficulty seems to be trying to re-install Postgres. If you

> already have created a database, the install program balks at having

> a data folder that is not empty, causing me to use the above

> workaround to copy back my data afterwards. Should be able to do

> this!

 

Again: the upgrade process is clearly documented in the manual.

 

 

Thomas

Hi George

 

Apologies to be rather grumpy, but I have been waiting a long time to get a glimmer of help!! Feeling a bit more positive now.

 

Thanks for coming back with more specifics. I haven’t done anything since your last email, as I have tried many times before what you (generally) suggested, but need more information to find a solution.

However, to answer your questions:

 

1)      I have used Start:Control Panel:Programs & Features:PostgreSQL:Uninstall/Change option to remove. Is there a special tool that does a cleaner job?

2)      I don’t know how to remove Postgres from the registry. I presume the uninstall method I have listed above does this, but seems to leave the following lines (presumably to keep my data intact):

  PostgreSQL:Installations:postgresql-9.2

  PostgreSQL:Services:postgresql-9.2

 

Please could you tell me how to clean Postgres from the registry, if this is still necessary?

 

3)      I don’t know how to remove the Windows postgres user, which I have been struggling to do for ages on Vista, but can’t find out how to do this. However, Thomas Kellerer has told me that this is not necessary any more. Which of you is correct?

4)      I do not have anything in C:\ProgramData\ pertaining to Postgres, as the installer put all my Postgres files in C:\Program Files\PostgreSQL\9.2, with my data set to C:\Program Files\PostgreSQL\9.2\data. I’ve put my data on the D: drive and re-named it to data_old, and deleted the contents of \data. Is this enough do you think?

5)      My machine is x32, so I have been using the 32 bit version.

 

Please can you answer my points above before I can try a reinstall?

 

Much thanks

  Stephen

 

----- Original Message -----

From: Stephen Brearley

 

<SNIP>

 

>I need someone to please look at my error log which I posted nearly six

>weeks ago, and tell me what is wrong.

 

Are you trying to tell us how to help you?  Or are you looking for help?

 

Since my e-mail suggesting that you work to get PostgreSQL to install

cleanly, did you:

 

    1. Unistall PostrgreSQL?  If so how?

    2. Remove all traces of PostgreSQL from the registry?

    3. Remove the Windows postgres user?

    4. Rename your current data directory to something other than

 

         - C:\Program Files\PostgreSQL\9.2\data

         - C:\ProgramData\PostgreSQL\9.2\data

 

    5. Having completed the above, try using the installer from

http://www.enterprisedb.com/postgresql-924-installers-win64?ls=Crossover&type=Crossover

        to re-install PostgreSQL?

 

If you did all of the above, what happened?

 

<SNIP>

 

George

Hi Raghu

 

Thanks for offering to help, but I don’t have Skype, as I am concerned about security issues. There seem to be some other companies out there which offer a similar service, but I haven’t yet determined which would best suit. I’m getting nagged from friends about this too..

 

Any thoughts from my subsequent posts please? I’m now thinking that because I manually moved my data to the D: drive and re-directed the regedit reference, the Windows Control Panel uninstall function may not have removed everything correctly, specifically the Windows user –however Thomas Kellerer says this is not used any more (as I understand him), but Postgres does not recognise the password I entered during re-installation (of the same version). So I’m still rather stuck, but I’ll try to perform a pg_dump.

 

Thanks

  Stephen

 

From: raghu ram [mailto:raghuchennuru@gmail.com]
Sent: 31 July 2013 12:45
To: Stephen Brearley
Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!!

 

Hi Stephen,

 

I would like to help you on this activity. Could you please share your SkypeID. 

 

Thanks & Regards

Raghu Ram

SkypeID: raghu.ramedb

 

On Wed, Jul 31, 2013 at 4:58 PM, Stephen Brearley <mail@stephenbrearley.name> wrote:

Hi Thomas

 

**Thanks for getting back to me**

 

In answer to your points:

 

1)      I could not get Postgresql to run correctly, so I assumed it could be a bug. I checked the documentation for bug reports, and this seemed to suggest that anything that appears to be a bug should be reported. If a decision is made that this is not a bug, it would be helpful if someone sent a short message to say so, and tell me to report my problem elsewhere. Otherwise I just sit there waiting and nothing happens!!

 

5) There does not appear to be a specific ‘Uninstall’ option on the Windows Start menu, so I went to Control Panel, Programs and features, PostgreSQL 9.2 Uninstall/Change option. Is this correct?

 

6) I have not performed an upgrade of Postgres. Inititially, I had no Postgres, then I installed postgresql-9.2.4-1-windows.exe, then I forgot my password as was using Navicat that remembers it automatically and tried to use pgAdmin which doesn’t, so I tried to reinstall (then of course remembered my password!). I have not been able to get Postgres to work correctly/connect since.

 

-Thank-you for confirming there are no hidden users –I spent many web searches trying to work out how to remove/reset these (whew)!!

 

No, I did not verify that Postgres was running, but have since checked in the Task Manager and it is running when I fire up pgAdmin. However, I should not get any error message during the install process, and to me this clearly suggests something is wrong, as the log I attached shows. Any ideas what is wrong please?

 

I would not normally do anything in the Registry, as I am aware that is asking for trouble. However, I hadn’t noted that I could specify a data location on my original install, so I checked the web and this appeared to be the only way to do this for some programs. I edited PostgreSQL|Installations|postgresql-9.2|Data Directory and changed the default from the C: drive to my folder on the D: drive as D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data. This worked fine until I had the password problems I mentioned above, and tried to do a reinstall, so I don’t think this registry edit is causing the problem. I have only recently found the postgresql.conf option on pgAdmin.

 

Where/what is init.db? I don’t have any instructions for this file. Not sure what you mean.

 

I too am now puzzled about pg.log. I think I believed this was related to ‘hidden’ Windows users which you say are not now used, so please disregard this point now.

 

I realise that new versions of Postgres go into a different file system on the C: drive, and that I can’t just move the system files across or rename directories. However, in this case I am trying to reinstall exactly the same version, so everything should be the same, so surely it should be okay to move my old data out of the way, remove the folder it was in, perform the reinstall and move the data back? Maybe it isn’t. I was not aware of this pg_dump/pg_restore, as these instructions are intended for upgrades, which of course I would not have read, as I am trying to perform a reinstall of the same version. Therefore I will try to perform a dump, then I guess remove all my Postgres folders in D:, then reinstall Postgres and run pg_restore to bring everything back in (though this doesn’t explain the errors in the installation log).

 

Regarding the password, I have typed in the same password which I used everytime I tried to install Postgres, so I started to think there was an install problem as listed in the installation log. The installation process paused with a popup error message which I did not have the first time I installed Postgres, and the log file indicates a return code other that ‘0’ near the end, so there is a problem there. Are there any restrictions on characters that can be used in passwords? I used a ‘complex’ password selecting one character from: # - < > ? @ \ /. If I entered the wrong password several times and performed a reinstall, does Postgres continue to lock me out after so many attempts, even if I perform a reinstall? Could this be the problem, and if so, how do I get around it?

 

Apologies this is a long response, but you have raised a number of important points.

 

Many thanks

  Stephen

 

*********************************************************************************

Stephen Brearley wrote on 29.07.2013 21:23:

> 1.Explain why my bug report has not been responded to

 

Because it's not a bug as you simply upgraded incorrectly.

 

> 5.Tell me how I should uninstall Postgres, if I am doing this wrong

 

You did run the "Uninstall", did you?

 

> 6.Tell me how to remove any hidden users or how I should reset/remove directories etc.

 

There are no hidden users - especially not with 9.2 (previous versions did create a new Windows user, but that is not the case with 9.2). Unfortunately you failed to mention from which version you upgraded.

 

> On re-installing Postgres, I have not been able to get it to work.

> During re-installation I get an error message saying the program

> exited with an error code, but otherwise appears to be okay. However,

> when I go into pgadmin and enter my password to connect to the server

> (any password gives the same response), I get a popup saying ‘Server

> doesn’t listen’, could not connect, connection refused etc’. The

> setup defaults to port 5432 during the install process. I’ve checked

> postgresql.conf which has not been installed, but I’ve looked at an

> old copy that I moved into the data folder, and that looks at port

> 5432.

 

And did you verify that Postgres was actually running (e.g. by looking into the taskmanager)

 

> Postgres was working okay before, so I don’t think it’s a problem

> with my system or firewall, as I have not changed anything. After my

> initial install, I edited the registry to point to the D: drive, as I

> prefer to have my data stored on a separate partition, and this

> worked okay.

 

What exactly did you "edit in the registry"? You shouldn't normally need to do that if you ran initdb correctly.

 

> Consequently it will not allow me access to pg.log

 

What is "pg.log"?

 

> The Postgres install will not install with a data folder that is not empty,

>so I had to re-name my data folder to data_old, and moved the contents back in

> afterwards.

 

What was the version before? If you upgrade from a major version to another (e.g. from 9.1 to 9.2) you can't just "copy" the data folder. You need to migrate it using pg_upgrade (which requires the old server to be still installed) or you need to use pg_dump and pg_restore to get the data from the old install into the new one.

 

This is clearly documented in the manual.

http://www.postgresql.org/docs/current/static/upgrading.html

 

> The registry seems to be pointing to the right place to find my data.

 

Again it should not be necessary to edit anything in the registry.

If you need to change the Windows service (which I assume you tried to do with hacking the registry) you should use pg_ctl for that.

 

 

> I don’t seem to be able to get anywhere with pgadmin, as

> when I try to connect I get a fatal password authentication error

> now.

 

Which means the server *is* running, you simply supplied the wrong password.

 

> pgadmin.log

> 2013-07-18 11:17:56 ERROR  : Error connecting to the server: FATAL:  password authentication failed for user "SDB"

 

That is not the logfile from your installation, it's a "normal" message from pgadmin that the password supplied for the user SDB was wrong. That has nothing to do with re-installing Postgres and clearly nothing with the "hidden" users you were referring to.

 

So apparently your new version **is** running correctly, you just have the wrong credentials.

 

> The main difficulty seems to be trying to re-install Postgres. If you

> already have created a database, the install program balks at having

> a data folder that is not empty, causing me to use the above

> workaround to copy back my data afterwards. Should be able to do

> this!

 

Again: the upgrade process is clearly documented in the manual.

 

 

Thomas

 

On Jul 31, 2013, at 14:07, "Stephen Brearley" <mail@stephenbrearley.name> wrote:

> Hi Alban
>
> Much thanks for getting back to me!
>
> The event file gets written to (as attached):
> C:\Users\SDB\AppData\Local\Temp

That's the installation log, not the postgres log.
I suspect the postgres log is either in the Windows Event Log (available from the Control Panel, perhaps under
AdministrativeTools or something similar) or in a file somewhere in the Postgres installation directory, most likely in
adirectory named log. I don't know how EnterpriseDB sets things up though, certainly not in Windows. 

Nevertheless, from the installation log it can be seen that initdb was run and that after that the database started up
successfully.

It also shows that some module named "adminpack" failed to install. I have no idea what that is though, I don't have it
onmy UNIX system. 
See:

Script output:
 Installing the adminpack module in the postgres database...
    Executing 'C:\Users\SDB\AppData\Local\Temp\rad5E7BA.bat'...
    Couldn't find the output file...
Failed to install the 'adminpack' module in the 'postgres' database
loadmodules.vbs ran to completion

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:\Program Files\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****"
"C:\ProgramFiles\PostgreSQL\9.2" "D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data" 5432 : Program ended with an error exit
code

So, whatever causes your issue is most likely due to something that happened after the install.

> I copied the contents of the /data directory to the D: drive, then changed
> the folder reference in the Registry. However, after this I was able to

Did you first stop the database? If not, chances are you didn't get a consistent copy, because the database was working
onthose files while you were copying them. 
Oh, and I assume your D: drive isn't some kind of network drive or something, but an actual disk with NTFS on it?

> create tables in Navicat without any problems, until I tried to use pgAdmin
> when it required my password, which I had forgotten. Then I tried to
> reinstall, and started having these problems..

So all the above is from before you uninstalled/reinstalled? Or is that log file you attached from the reinstall?
In that case, it seems to have known about your data-directory on D: during the install, looking at this snippet:

Loading additional SQL modules...
Executing cscript //NoLogo "C:\Program Files\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****"
"C:\ProgramFiles\PostgreSQL\9.2" "D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data" 5432 
Script exit code: 2

It exits with code 2, which indicates an error. Perhaps the logs (see earlier) say why.

> I'm being recommended to try running pg_dump by Thomas Kellerer, then remove
> all my data folders and a reinstall. I get the feeling it is not moving my
> data to the D: drive that has caused the problem, but that the Uninstall has
> not cleaned this out correctly, as I moved my data to D:/../data_old to
> enable Postgres to reinstall and used the installation Wizard to point to my
> data location, but still get installation errors and a connection problem,
> despite using the 'correct' password.

I doubt that the uninstaller would remove your data directory, because then you would lose your data. You don't want
that,it's generally better to leave decisions like that up to the administrator (you). That data is more often than not
quitevaluable ;) 

> When I start pgAdmin, TaskManager shows that Postgres is running, -so I
> don't think I have an unrecoverable database snapshot?

That Postgres appears to be running is encouraging.

Something worth verifying; open a command prompt and type netstat -an and look whether the port you configured Postgres
torun on is being listened on. 

If it is, then your issue is just a connection issue. Perhaps you could elaborate on what you're doing to connect and
whaterror you receive? 

It's possible that you locked yourself out through the pg_hba.conf file or that you need to reset the password for the
postgresuser. But we don't know that yet... 


> -----Original Message-----
> From: Alban Hertroys [mailto:haramrae@gmail.com]
> Sent: 31 July 2013 11:48
> To: Stephen Brearley
> Cc: 'Adrian Klaver'; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400,
> re-installation failure PLEASE CAN SOMEONE HELP!!
>
> On Jul 31, 2013, at 12:07, "Stephen Brearley" <mail@stephenbrearley.name>
> wrote:
>
>> Both the install and uninstall should work flawlessly. The only thing
>> I can see is that I have installed the program once before, and I have
>> put my data on my d: drive to separate it from the program in case of
>> software problems, but I got Postgresql to correctly find my data before..
>
>
> If Postgres is having any issues starting up, details should be in the log
> file. I don't know where that file gets written on a Windows system though,
> perhaps it ends up in the Windows Event log?
>
> What procedure did you follow to move your data to the D-drive? That seems a
> likely cause of trouble, especially if the database was running while you
> did that - you may be looking at an unrecoverable database snapshot if you
> didn't take precautions, in which case the database would refuse to start
> up.
>
> Alban Hertroys
> --
> If you can't see the forest for the trees, cut the trees and you'll find
> there is no forest.
>
> <install-postgresql.log>

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



Hi Stephen,

As per my experience, installing postgresql on windows machine automatically create postgres user. When you uninstall it, the postgres user doesn't automatically removed, you must remove it manually.

So, when you install postgres for the second time, it will use existing postgres user which already exist therefore uses the password which you have forgotten.

Try uninstall postgresql and remove postgres user, or alternatively, reset postgres user password from Computer Management.

Regards,
Nur Hidayat



.
Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT

From: "Stephen Brearley" <mail@stephenbrearley.name>
Sender: pgsql-general-owner@postgresql.org
Date: Wed, 31 Jul 2013 12:28:57 +0100
To: <spam_eater@gmx.net>
Cc: <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!!

Hi Thomas

 

**Thanks for getting back to me**

 

In answer to your points:

 

1)      I could not get Postgresql to run correctly, so I assumed it could be a bug. I checked the documentation for bug reports, and this seemed to suggest that anything that appears to be a bug should be reported. If a decision is made that this is not a bug, it would be helpful if someone sent a short message to say so, and tell me to report my problem elsewhere. Otherwise I just sit there waiting and nothing happens!!

 

5) There does not appear to be a specific ‘Uninstall’ option on the Windows Start menu, so I went to Control Panel, Programs and features, PostgreSQL 9.2 Uninstall/Change option. Is this correct?

 

6) I have not performed an upgrade of Postgres. Inititially, I had no Postgres, then I installed postgresql-9.2.4-1-windows.exe, then I forgot my password as was using Navicat that remembers it automatically and tried to use pgAdmin which doesn’t, so I tried to reinstall (then of course remembered my password!). I have not been able to get Postgres to work correctly/connect since.

 

-Thank-you for confirming there are no hidden users –I spent many web searches trying to work out how to remove/reset these (whew)!!

 

No, I did not verify that Postgres was running, but have since checked in the Task Manager and it is running when I fire up pgAdmin. However, I should not get any error message during the install process, and to me this clearly suggests something is wrong, as the log I attached shows. Any ideas what is wrong please?

 

I would not normally do anything in the Registry, as I am aware that is asking for trouble. However, I hadn’t noted that I could specify a data location on my original install, so I checked the web and this appeared to be the only way to do this for some programs. I edited PostgreSQL|Installations|postgresql-9.2|Data Directory and changed the default from the C: drive to my folder on the D: drive as D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data. This worked fine until I had the password problems I mentioned above, and tried to do a reinstall, so I don’t think this registry edit is causing the problem. I have only recently found the postgresql.conf option on pgAdmin.

 

Where/what is init.db? I don’t have any instructions for this file. Not sure what you mean.

 

I too am now puzzled about pg.log. I think I believed this was related to ‘hidden’ Windows users which you say are not now used, so please disregard this point now.

 

I realise that new versions of Postgres go into a different file system on the C: drive, and that I can’t just move the system files across or rename directories. However, in this case I am trying to reinstall exactly the same version, so everything should be the same, so surely it should be okay to move my old data out of the way, remove the folder it was in, perform the reinstall and move the data back? Maybe it isn’t. I was not aware of this pg_dump/pg_restore, as these instructions are intended for upgrades, which of course I would not have read, as I am trying to perform a reinstall of the same version. Therefore I will try to perform a dump, then I guess remove all my Postgres folders in D:, then reinstall Postgres and run pg_restore to bring everything back in (though this doesn’t explain the errors in the installation log).

 

Regarding the password, I have typed in the same password which I used everytime I tried to install Postgres, so I started to think there was an install problem as listed in the installation log. The installation process paused with a popup error message which I did not have the first time I installed Postgres, and the log file indicates a return code other that ‘0’ near the end, so there is a problem there. Are there any restrictions on characters that can be used in passwords? I used a ‘complex’ password selecting one character from: # - < > ? @ \ /. If I entered the wrong password several times and performed a reinstall, does Postgres continue to lock me out after so many attempts, even if I perform a reinstall? Could this be the problem, and if so, how do I get around it?

 

Apologies this is a long response, but you have raised a number of important points.

 

Many thanks

  Stephen

 

*********************************************************************************

Stephen Brearley wrote on 29.07.2013 21:23:

> 1.Explain why my bug report has not been responded to

 

Because it's not a bug as you simply upgraded incorrectly.

 

> 5.Tell me how I should uninstall Postgres, if I am doing this wrong

 

You did run the "Uninstall", did you?

 

> 6.Tell me how to remove any hidden users or how I should reset/remove directories etc.

 

There are no hidden users - especially not with 9.2 (previous versions did create a new Windows user, but that is not the case with 9.2). Unfortunately you failed to mention from which version you upgraded.

 

> On re-installing Postgres, I have not been able to get it to work.

> During re-installation I get an error message saying the program

> exited with an error code, but otherwise appears to be okay. However,

> when I go into pgadmin and enter my password to connect to the server

> (any password gives the same response), I get a popup saying ‘Server

> doesn’t listen’, could not connect, connection refused etc’. The

> setup defaults to port 5432 during the install process. I’ve checked

> postgresql.conf which has not been installed, but I’ve looked at an

> old copy that I moved into the data folder, and that looks at port

> 5432.

 

And did you verify that Postgres was actually running (e.g. by looking into the taskmanager)

 

> Postgres was working okay before, so I don’t think it’s a problem

> with my system or firewall, as I have not changed anything. After my

> initial install, I edited the registry to point to the D: drive, as I

> prefer to have my data stored on a separate partition, and this

> worked okay.

 

What exactly did you "edit in the registry"? You shouldn't normally need to do that if you ran initdb correctly.

 

> Consequently it will not allow me access to pg.log

 

What is "pg.log"?

 

> The Postgres install will not install with a data folder that is not empty,

>so I had to re-name my data folder to data_old, and moved the contents back in

> afterwards.

 

What was the version before? If you upgrade from a major version to another (e.g. from 9.1 to 9.2) you can't just "copy" the data folder. You need to migrate it using pg_upgrade (which requires the old server to be still installed) or you need to use pg_dump and pg_restore to get the data from the old install into the new one.

 

This is clearly documented in the manual.

http://www.postgresql.org/docs/current/static/upgrading.html

 

> The registry seems to be pointing to the right place to find my data.

 

Again it should not be necessary to edit anything in the registry.

If you need to change the Windows service (which I assume you tried to do with hacking the registry) you should use pg_ctl for that.

 

 

> I don’t seem to be able to get anywhere with pgadmin, as

> when I try to connect I get a fatal password authentication error

> now.

 

Which means the server *is* running, you simply supplied the wrong password.

 

> pgadmin.log

> 2013-07-18 11:17:56 ERROR  : Error connecting to the server: FATAL:  password authentication failed for user "SDB"

 

That is not the logfile from your installation, it's a "normal" message from pgadmin that the password supplied for the user SDB was wrong. That has nothing to do with re-installing Postgres and clearly nothing with the "hidden" users you were referring to.

 

So apparently your new version **is** running correctly, you just have the wrong credentials.

 

> The main difficulty seems to be trying to re-install Postgres. If you

> already have created a database, the install program balks at having

> a data folder that is not empty, causing me to use the above

> workaround to copy back my data afterwards. Should be able to do

> this!

 

Again: the upgrade process is clearly documented in the manual.

 

 

Thomas

On 07/31/2013 04:28 AM, Stephen Brearley wrote:
> Hi Thomas
>
> **Thanks for getting back to me**
>
>
> I would not normally do anything in the Registry, as I am aware that is
> asking for trouble. However, I hadn’t noted that I could specify a data
> location on my original install, so I checked the web and this appeared
> to be the only way to do this for some programs. I edited
> PostgreSQL|Installations|postgresql-9.2|Data Directory and changed the
> default from the C: drive to my folder on the D: drive as
> D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data. This worked fine until I had
> the password problems I mentioned above, and tried to do a reinstall, so
> I don’t think this registry edit is causing the problem.

Actually, per Albans comment it is. The installer is seeing the data
directory on D:\. Might try undoing that registry entry.

The basic problem is you have two instances of a Postgres cluster(one on
C:\ and one on D:\) and one instance of Postgres running with confusing
information on where to find the appropriate cluster(the registry entry,
the recent install information). To make head way on this you need to
unclutter things. Before we go down that path, how important is the data
in the database you initially created?


--
Adrian Klaver
adrian.klaver@gmail.com


Hi Alban

Much thanks for getting back to me!

The event file gets written to (as attached):
C:\Users\SDB\AppData\Local\Temp

I copied the contents of the /data directory to the D: drive, then changed
the folder reference in the Registry. However, after this I was able to
create tables in Navicat without any problems, until I tried to use pgAdmin
when it required my password, which I had forgotten. Then I tried to
reinstall, and started having these problems..

I'm being recommended to try running pg_dump by Thomas Kellerer, then remove
all my data folders and a reinstall. I get the feeling it is not moving my
data to the D: drive that has caused the problem, but that the Uninstall has
not cleaned this out correctly, as I moved my data to D:/../data_old to
enable Postgres to reinstall and used the installation Wizard to point to my
data location, but still get installation errors and a connection problem,
despite using the 'correct' password.

When I start pgAdmin, TaskManager shows that Postgres is running, -so I
don't think I have an unrecoverable database snapshot?

Thanks
  Stephen

-----Original Message-----
From: Alban Hertroys [mailto:haramrae@gmail.com]
Sent: 31 July 2013 11:48
To: Stephen Brearley
Cc: 'Adrian Klaver'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400,
re-installation failure PLEASE CAN SOMEONE HELP!!

On Jul 31, 2013, at 12:07, "Stephen Brearley" <mail@stephenbrearley.name>
wrote:

> Both the install and uninstall should work flawlessly. The only thing
> I can see is that I have installed the program once before, and I have
> put my data on my d: drive to separate it from the program in case of
> software problems, but I got Postgresql to correctly find my data before..


If Postgres is having any issues starting up, details should be in the log
file. I don't know where that file gets written on a Windows system though,
perhaps it ends up in the Windows Event log?

What procedure did you follow to move your data to the D-drive? That seems a
likely cause of trouble, especially if the database was running while you
did that - you may be looking at an unrecoverable database snapshot if you
didn't take precautions, in which case the database would refuse to start
up.

Alban Hertroys
--
If you can't see the forest for the trees, cut the trees and you'll find
there is no forest.


Attachment
Hi Alban

Think we are making progress..

I'll need to do some research to understand how to find the event log, but
to answer your other points:

1) Glad to see you think the database started up correctly. I also noted
this problem about adminpack, and spent ages trying to find out what it was
and why it was not now installing correctly, but so far I have drawn a
blank. It interrupted the installation with a pop-up error message, although
it did allow me to continue. That was why I thought it was a program bug,
and tried to report it!
2) Yes, I did stop the Postgres before moving my data. I moved my data to
\data_old, then did the uninstall, re-installed it, stopped the program and
moved the data from \data_old back to \data and re-started Postgres. I also
checked that my registry settings for Postgres were pointing to the correct
data folder on the D: drive (which is why the install may know about it),
which is just a separate partition on my PC. Before I had any of these
problems, Postgres was able to successfully read and write to this location.
I was using Navicat to create a few basic tables, and did manage to log into
pgAdmin.
3) The log file I have attached is from the last re-install. Every time I
have uninstalled and re-installed since my first successful attempt has
produced the same (unsuccessful) result, so I think any of these logs will
show the same issues.
4) The Postgres help files seem to suggest that during an uninstall, the
/data folder will not be deleted, which seems quite sensible, as you say!
Only thing is, the system requires it to be empty during an install, as folk
are expected to either install Postgres for the first time, or perform an
upgrade which uses a different 9.x folder, and not have to reinstall the
same version. This is why I have to shift my data out of the way to
/data_old and shift it back. Assuming I can do this without using
dump/restore (another question).
5) I typed netstat -an, and found port 5432 was shown as:
  Local Address: [::]:5432, Foreign Address: [::]:0, State: LISTENING

I don't think I chose this port, I think the install defaulted to it. I
don't know if this is the right one I should choose. According to Wikipedia,
this is the default port for Postgres on TCP/UDP, although my system does
not seem to be listening on UDP, but I think just listening on TCP is
probably fine.
6) This question about connecting -I think- could be what the problem is. To
connect, I start pgAdmin and double-click on Server
groups|Servers|myLocalHost (localhost:5432) which has a red 'X' on it
(doesn't look good) to which I get a popup 'Error connecting to the server:
FATAL: password authentication failed for user "SDB"'. You mention the
pg_hba.conf file -but since I am asked to enter a new password during
installation, this is reset every time I try to do a reinstall? I am
thinking that this is not occurring, and I have entered to many wrong
passwords. For security, it would make sense that you can't reset it just by
performing a reinstall. Could you elaborate on how to get back in if I have
locked myself out please, as I think this could..be it?

Many thanks again
  Stephen

-----Original Message-----
From: Alban Hertroys [mailto:haramrae@gmail.com]
Sent: 31 July 2013 14:16
To: Stephen Brearley
Cc: pgsql-general@postgresql.org; 'Adrian Klaver'
Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400,
re-installation failure PLEASE CAN SOMEONE HELP!!

On Jul 31, 2013, at 14:07, "Stephen Brearley" <mail@stephenbrearley.name>
wrote:

> Hi Alban
>
> Much thanks for getting back to me!
>
> The event file gets written to (as attached):
> C:\Users\SDB\AppData\Local\Temp

That's the installation log, not the postgres log.
I suspect the postgres log is either in the Windows Event Log (available
from the Control Panel, perhaps under Administrative Tools or something
similar) or in a file somewhere in the Postgres installation directory, most
likely in a directory named log. I don't know how EnterpriseDB sets things
up though, certainly not in Windows.

Nevertheless, from the installation log it can be seen that initdb was run
and that after that the database started up successfully.

It also shows that some module named "adminpack" failed to install. I have
no idea what that is though, I don't have it on my UNIX system.
See:

Script output:
 Installing the adminpack module in the postgres database...
    Executing 'C:\Users\SDB\AppData\Local\Temp\rad5E7BA.bat'...
    Couldn't find the output file...
Failed to install the 'adminpack' module in the 'postgres' database
loadmodules.vbs ran to completion

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:\Program
Files\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****"
"C:\Program Files\PostgreSQL\9.2"
"D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data" 5432 : Program ended with an
error exit code

So, whatever causes your issue is most likely due to something that happened
after the install.

> I copied the contents of the /data directory to the D: drive, then
> changed the folder reference in the Registry. However, after this I
> was able to

Did you first stop the database? If not, chances are you didn't get a
consistent copy, because the database was working on those files while you
were copying them.
Oh, and I assume your D: drive isn't some kind of network drive or
something, but an actual disk with NTFS on it?

> create tables in Navicat without any problems, until I tried to use
> pgAdmin when it required my password, which I had forgotten. Then I
> tried to reinstall, and started having these problems..

So all the above is from before you uninstalled/reinstalled? Or is that log
file you attached from the reinstall?
In that case, it seems to have known about your data-directory on D: during
the install, looking at this snippet:

Loading additional SQL modules...
Executing cscript //NoLogo "C:\Program
Files\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****"
"C:\Program Files\PostgreSQL\9.2"
"D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data" 5432 Script exit code: 2

It exits with code 2, which indicates an error. Perhaps the logs (see
earlier) say why.

> I'm being recommended to try running pg_dump by Thomas Kellerer, then
> remove all my data folders and a reinstall. I get the feeling it is
> not moving my data to the D: drive that has caused the problem, but
> that the Uninstall has not cleaned this out correctly, as I moved my
> data to D:/../data_old to enable Postgres to reinstall and used the
> installation Wizard to point to my data location, but still get
> installation errors and a connection problem, despite using the 'correct'
password.

I doubt that the uninstaller would remove your data directory, because then
you would lose your data. You don't want that, it's generally better to
leave decisions like that up to the administrator (you). That data is more
often than not quite valuable ;)

> When I start pgAdmin, TaskManager shows that Postgres is running, -so
> I don't think I have an unrecoverable database snapshot?

That Postgres appears to be running is encouraging.

Something worth verifying; open a command prompt and type netstat -an and
look whether the port you configured Postgres to run on is being listened
on.

If it is, then your issue is just a connection issue. Perhaps you could
elaborate on what you're doing to connect and what error you receive?

It's possible that you locked yourself out through the pg_hba.conf file or
that you need to reset the password for the postgres user. But we don't know
that yet...


> -----Original Message-----
> From: Alban Hertroys [mailto:haramrae@gmail.com]
> Sent: 31 July 2013 11:48
> To: Stephen Brearley
> Cc: 'Adrian Klaver'; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro
> 400, re-installation failure PLEASE CAN SOMEONE HELP!!
>
> On Jul 31, 2013, at 12:07, "Stephen Brearley"
> <mail@stephenbrearley.name>
> wrote:
>
>> Both the install and uninstall should work flawlessly. The only thing
>> I can see is that I have installed the program once before, and I
>> have put my data on my d: drive to separate it from the program in
>> case of software problems, but I got Postgresql to correctly find my data
before..
>
>
> If Postgres is having any issues starting up, details should be in the
> log file. I don't know where that file gets written on a Windows
> system though, perhaps it ends up in the Windows Event log?
>
> What procedure did you follow to move your data to the D-drive? That
> seems a likely cause of trouble, especially if the database was
> running while you did that - you may be looking at an unrecoverable
> database snapshot if you didn't take precautions, in which case the
> database would refuse to start up.
>
> Alban Hertroys
> --
> If you can't see the forest for the trees, cut the trees and you'll
> find there is no forest.
>
> <install-postgresql.log>

Alban Hertroys
--
If you can't see the forest for the trees, cut the trees and you'll find
there is no forest.




Hi Nur

 

Yes, I’m almost sure this is the thing that is causing the main problem, despite other apparent installation bug red herrings. I have had Alban Hertroys pick up on the same thing.

 

But...how do I do this please? Please can you give me some basic instructions.

 

Thanks

  Stephen

 

From: hidayat365@gmail.com [mailto:hidayat365@gmail.com]
Sent: 31 July 2013 14:53
To: Stephen Brearley; pgsql-general-owner@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!!

 

Hi Stephen,

As per my experience, installing postgresql on windows machine automatically create postgres user. When you uninstall it, the postgres user doesn't automatically removed, you must remove it manually.

So, when you install postgres for the second time, it will use existing postgres user which already exist therefore uses the password which you have forgotten.

Try uninstall postgresql and remove postgres user, or alternatively, reset postgres user password from Computer Management.

Regards,
Nur Hidayat



.

Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT


From: "Stephen Brearley" <mail@stephenbrearley.name>

Date: Wed, 31 Jul 2013 12:28:57 +0100

Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400, re-installation failure PLEASE CAN SOMEONE HELP!!

 

Hi Thomas

 

**Thanks for getting back to me**

 

In answer to your points:

 

1)      I could not get Postgresql to run correctly, so I assumed it could be a bug. I checked the documentation for bug reports, and this seemed to suggest that anything that appears to be a bug should be reported. If a decision is made that this is not a bug, it would be helpful if someone sent a short message to say so, and tell me to report my problem elsewhere. Otherwise I just sit there waiting and nothing happens!!

 

5) There does not appear to be a specific ‘Uninstall’ option on the Windows Start menu, so I went to Control Panel, Programs and features, PostgreSQL 9.2 Uninstall/Change option. Is this correct?

 

6) I have not performed an upgrade of Postgres. Inititially, I had no Postgres, then I installed postgresql-9.2.4-1-windows.exe, then I forgot my password as was using Navicat that remembers it automatically and tried to use pgAdmin which doesn’t, so I tried to reinstall (then of course remembered my password!). I have not been able to get Postgres to work correctly/connect since.

 

-Thank-you for confirming there are no hidden users –I spent many web searches trying to work out how to remove/reset these (whew)!!

 

No, I did not verify that Postgres was running, but have since checked in the Task Manager and it is running when I fire up pgAdmin. However, I should not get any error message during the install process, and to me this clearly suggests something is wrong, as the log I attached shows. Any ideas what is wrong please?

 

I would not normally do anything in the Registry, as I am aware that is asking for trouble. However, I hadn’t noted that I could specify a data location on my original install, so I checked the web and this appeared to be the only way to do this for some programs. I edited PostgreSQL|Installations|postgresql-9.2|Data Directory and changed the default from the C: drive to my folder on the D: drive as D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data. This worked fine until I had the password problems I mentioned above, and tried to do a reinstall, so I don’t think this registry edit is causing the problem. I have only recently found the postgresql.conf option on pgAdmin.

 

Where/what is init.db? I don’t have any instructions for this file. Not sure what you mean.

 

I too am now puzzled about pg.log. I think I believed this was related to ‘hidden’ Windows users which you say are not now used, so please disregard this point now.

 

I realise that new versions of Postgres go into a different file system on the C: drive, and that I can’t just move the system files across or rename directories. However, in this case I am trying to reinstall exactly the same version, so everything should be the same, so surely it should be okay to move my old data out of the way, remove the folder it was in, perform the reinstall and move the data back? Maybe it isn’t. I was not aware of this pg_dump/pg_restore, as these instructions are intended for upgrades, which of course I would not have read, as I am trying to perform a reinstall of the same version. Therefore I will try to perform a dump, then I guess remove all my Postgres folders in D:, then reinstall Postgres and run pg_restore to bring everything back in (though this doesn’t explain the errors in the installation log).

 

Regarding the password, I have typed in the same password which I used everytime I tried to install Postgres, so I started to think there was an install problem as listed in the installation log. The installation process paused with a popup error message which I did not have the first time I installed Postgres, and the log file indicates a return code other that ‘0’ near the end, so there is a problem there. Are there any restrictions on characters that can be used in passwords? I used a ‘complex’ password selecting one character from: # - < > ? @ \ /. If I entered the wrong password several times and performed a reinstall, does Postgres continue to lock me out after so many attempts, even if I perform a reinstall? Could this be the problem, and if so, how do I get around it?

 

Apologies this is a long response, but you have raised a number of important points.

 

Many thanks

  Stephen

 

*********************************************************************************

Stephen Brearley wrote on 29.07.2013 21:23:

> 1.Explain why my bug report has not been responded to

 

Because it's not a bug as you simply upgraded incorrectly.

 

> 5.Tell me how I should uninstall Postgres, if I am doing this wrong

 

You did run the "Uninstall", did you?

 

> 6.Tell me how to remove any hidden users or how I should reset/remove directories etc.

 

There are no hidden users - especially not with 9.2 (previous versions did create a new Windows user, but that is not the case with 9.2). Unfortunately you failed to mention from which version you upgraded.

 

> On re-installing Postgres, I have not been able to get it to work.

> During re-installation I get an error message saying the program

> exited with an error code, but otherwise appears to be okay. However,

> when I go into pgadmin and enter my password to connect to the server

> (any password gives the same response), I get a popup saying ‘Server

> doesn’t listen’, could not connect, connection refused etc’. The

> setup defaults to port 5432 during the install process. I’ve checked

> postgresql.conf which has not been installed, but I’ve looked at an

> old copy that I moved into the data folder, and that looks at port

> 5432.

 

And did you verify that Postgres was actually running (e.g. by looking into the taskmanager)

 

> Postgres was working okay before, so I don’t think it’s a problem

> with my system or firewall, as I have not changed anything. After my

> initial install, I edited the registry to point to the D: drive, as I

> prefer to have my data stored on a separate partition, and this

> worked okay.

 

What exactly did you "edit in the registry"? You shouldn't normally need to do that if you ran initdb correctly.

 

> Consequently it will not allow me access to pg.log

 

What is "pg.log"?

 

> The Postgres install will not install with a data folder that is not empty,

>so I had to re-name my data folder to data_old, and moved the contents back in

> afterwards.

 

What was the version before? If you upgrade from a major version to another (e.g. from 9.1 to 9.2) you can't just "copy" the data folder. You need to migrate it using pg_upgrade (which requires the old server to be still installed) or you need to use pg_dump and pg_restore to get the data from the old install into the new one.

 

This is clearly documented in the manual.

http://www.postgresql.org/docs/current/static/upgrading.html

 

> The registry seems to be pointing to the right place to find my data.

 

Again it should not be necessary to edit anything in the registry.

If you need to change the Windows service (which I assume you tried to do with hacking the registry) you should use pg_ctl for that.

 

 

> I don’t seem to be able to get anywhere with pgadmin, as

> when I try to connect I get a fatal password authentication error

> now.

 

Which means the server *is* running, you simply supplied the wrong password.

 

> pgadmin.log

> 2013-07-18 11:17:56 ERROR  : Error connecting to the server: FATAL:  password authentication failed for user "SDB"

 

That is not the logfile from your installation, it's a "normal" message from pgadmin that the password supplied for the user SDB was wrong. That has nothing to do with re-installing Postgres and clearly nothing with the "hidden" users you were referring to.

 

So apparently your new version **is** running correctly, you just have the wrong credentials.

 

> The main difficulty seems to be trying to re-install Postgres. If you

> already have created a database, the install program balks at having

> a data folder that is not empty, causing me to use the above

> workaround to copy back my data afterwards. Should be able to do

> this!

 

Again: the upgrade process is clearly documented in the manual.

 

 

Thomas

Alban Hertroys, 31.07.2013 15:16:
> I suspect the postgres log is either in the Windows Event Log
> (available from the Control Panel, perhaps under Administrative Tools
> or something similar) or in a file somewhere in the Postgres
> installation directory, most likely in a directory named log.

It's in a directory named pg_log in the *data* directory, not the installation directory

The relevant line in the installer log is:

   processed file: D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data\pg_log

Regards
Thomas

hidayat365@gmail.com, 31.07.2013 15:52:
> As per my experience, installing postgresql on windows machine
> automatically create postgres user. When you uninstall it, the
> postgres user doesn't automatically removed, you must remove it
> manually.

Not any more.

Since 9.1 (or was it 9.2?) Postgres uses a pre-defined Windows account (the "Network account") for this.


On 01/08/2013 10:27, Stephen Brearley wrote:

> 6) This question about connecting -I think- could be what the problem is. To
> connect, I start pgAdmin and double-click on Server
> groups|Servers|myLocalHost (localhost:5432) which has a red 'X' on it
> (doesn't look good) to which I get a popup 'Error connecting to the server:
> FATAL: password authentication failed for user "SDB"'. You mention the
> pg_hba.conf file -but since I am asked to enter a new password during
> installation, this is reset every time I try to do a reinstall? I am
> thinking that this is not occurring, and I have entered to many wrong
> passwords. For security, it would make sense that you can't reset it just by
> performing a reinstall. Could you elaborate on how to get back in if I have
> locked myself out please, as I think this could..be it?

Hi there,

If you're locked out, you don't have to reinstall - you can do the
following:

(i) Locate pg_hba.conf - this should be in your data directory (not the
installation directory).

(ii) Edit it, and change the connection method for the relevant user
and/or host from "md5" to "trust". - This will let that user connection
without a password.

(iii) Restart the server so the connection method change takes effect.

(iv) Connect, and reset your password (ALTER ROLE....).

(v) Edit pg_hba.conf once more and change the connection method back to
"md5".

(vi) Restart the server once more.

HTH,

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


On Aug 1, 2013, at 11:27, Stephen Brearley <mail@stephenbrearley.name> wrote:

> Hi Alban
>
> Think we are making progress..
>
> I'll need to do some research to understand how to find the event log, but
> to answer your other points:
>
> 1) Glad to see you think the database started up correctly. I also noted
> this problem about adminpack, and spent ages trying to find out what it was
> and why it was not now installing correctly, but so far I have drawn a
> blank. It interrupted the installation with a pop-up error message, although
> it did allow me to continue. That was why I thought it was a program bug,
> and tried to report it!

That does indeed seem like an issue with the installer. I suspect the EnterpriseDB people (who create the Windows
package)are following this thread and will follow up on this, but perhaps it wouldn't hurt to contact them directly
aboutthis ;) 

> 2) Yes, I did stop the Postgres before moving my data. I moved my data to
> \data_old, then did the uninstall, re-installed it, stopped the program and
> moved the data from \data_old back to \data and re-started Postgres. I also
> checked that my registry settings for Postgres were pointing to the correct
> data folder on the D: drive (which is why the install may know about it),
> which is just a separate partition on my PC. Before I had any of these
> problems, Postgres was able to successfully read and write to this location.
> I was using Navicat to create a few basic tables, and did manage to log into
> pgAdmin.

I can't see any flaw in that.

Out of curiosity, is that a separate partition on the same disk? If so, what benefit do you expect from that?
If you were talking about a separate disk (one that doesn't contain the Windows page-file, for example) then it makes
senseto do so, but on the same disk I don't really see the benefit… Easier with backups, perhaps? 

> 3) The log file I have attached is from the last re-install. Every time I
> have uninstalled and re-installed since my first successful attempt has
> produced the same (unsuccessful) result, so I think any of these logs will
> show the same issues.

Probably, yes.

> 4) The Postgres help files seem to suggest that during an uninstall, the
> /data folder will not be deleted, which seems quite sensible, as you say!
> Only thing is, the system requires it to be empty during an install, as folk
> are expected to either install Postgres for the first time, or perform an
> upgrade which uses a different 9.x folder, and not have to reinstall the
> same version. This is why I have to shift my data out of the way to
> /data_old and shift it back. Assuming I can do this without using
> dump/restore (another question).

Yes, with the same major version of the database (PG 9.2 in your case), you can.
I think the issue at hand here is that the installer doesn't know whether any pre-existing data is for the same major
versionor not and therefore cannot assume it is safe to keep it around. 

Having to re-install the same version is a bit uncommon, I suppose, but you'd probably run into the same issue if you
wereto perform a minor version upgrade (say 9.2.4 to 9.2.5)? 

> 5) I typed netstat -an, and found port 5432 was shown as:
>  Local Address: [::]:5432, Foreign Address: [::]:0, State: LISTENING
>
> I don't think I chose this port, I think the install defaulted to it. I
> don't know if this is the right one I should choose. According to Wikipedia,
> this is the default port for Postgres on TCP/UDP, although my system does
> not seem to be listening on UDP, but I think just listening on TCP is
> probably fine.

Yes, that's the default port and it shows that the database is indeed running and listening. So far so good!

> 6) This question about connecting -I think- could be what the problem is. To
> connect, I start pgAdmin and double-click on Server
> groups|Servers|myLocalHost (localhost:5432) which has a red 'X' on it
> (doesn't look good) to which I get a popup 'Error connecting to the server:
> FATAL: password authentication failed for user "SDB"'. You mention the
> pg_hba.conf file -but since I am asked to enter a new password during
> installation, this is reset every time I try to do a reinstall? I am
> thinking that this is not occurring, and I have entered to many wrong
> passwords. For security, it would make sense that you can't reset it just by
> performing a reinstall. Could you elaborate on how to get back in if I have
> locked myself out please, as I think this could..be it?

Well, pg_hba.conf (which location is mentioned by Raymond further down this thread) doesn't contain your passwords but
isthe configuration file to specify what authentication methods (if any) are required to connect from what hosts. 
Apparently that file says to use password authentication for the host you're connecting from. If you're on the same
machineas the database is (I suspect you are), that would be "localhost". 

That's another file that the installer does not touch if it exists, for similar reasons as why it doesn't touch your
data;the contents of that file can be quite elaborate in larger installations. 

Another thing that I wonder about; can you connect to the database using the standard "postgres" (without quotes) user?
That'sthe default admin user. It wouldn't surprise me if there's simply no database account for user "SDB"! 

If you can connect using the postgres user, you can then also create a database account for your SDB user.

P.S. In this mailing list it is not customary to top-post. You're on a Micrososft OS, possibly using the abomination of
amail client called Outlook, so you can possibly not help it, but if you can, please reply in context so that we don't
haveto reverse-read your messages. 

> -----Original Message-----
> From: Alban Hertroys [mailto:haramrae@gmail.com]
> Sent: 31 July 2013 14:16
> To: Stephen Brearley
> Cc: pgsql-general@postgresql.org; 'Adrian Klaver'
> Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro 400,
> re-installation failure PLEASE CAN SOMEONE HELP!!
>
> On Jul 31, 2013, at 14:07, "Stephen Brearley" <mail@stephenbrearley.name>
> wrote:
>
>> Hi Alban
>>
>> Much thanks for getting back to me!
>>
>> The event file gets written to (as attached):
>> C:\Users\SDB\AppData\Local\Temp
>
> That's the installation log, not the postgres log.
> I suspect the postgres log is either in the Windows Event Log (available
> from the Control Panel, perhaps under Administrative Tools or something
> similar) or in a file somewhere in the Postgres installation directory, most
> likely in a directory named log. I don't know how EnterpriseDB sets things
> up though, certainly not in Windows.
>
> Nevertheless, from the installation log it can be seen that initdb was run
> and that after that the database started up successfully.
>
> It also shows that some module named "adminpack" failed to install. I have
> no idea what that is though, I don't have it on my UNIX system.
> See:
>
> Script output:
> Installing the adminpack module in the postgres database...
>    Executing 'C:\Users\SDB\AppData\Local\Temp\rad5E7BA.bat'...
>    Couldn't find the output file...
> Failed to install the 'adminpack' module in the 'postgres' database
> loadmodules.vbs ran to completion
>
> Script stderr:
> Program ended with an error exit code
>
> Error running cscript //NoLogo "C:\Program
> Files\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****"
> "C:\Program Files\PostgreSQL\9.2"
> "D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data" 5432 : Program ended with an
> error exit code
>
> So, whatever causes your issue is most likely due to something that happened
> after the install.
>
>> I copied the contents of the /data directory to the D: drive, then
>> changed the folder reference in the Registry. However, after this I
>> was able to
>
> Did you first stop the database? If not, chances are you didn't get a
> consistent copy, because the database was working on those files while you
> were copying them.
> Oh, and I assume your D: drive isn't some kind of network drive or
> something, but an actual disk with NTFS on it?
>
>> create tables in Navicat without any problems, until I tried to use
>> pgAdmin when it required my password, which I had forgotten. Then I
>> tried to reinstall, and started having these problems..
>
> So all the above is from before you uninstalled/reinstalled? Or is that log
> file you attached from the reinstall?
> In that case, it seems to have known about your data-directory on D: during
> the install, looking at this snippet:
>
> Loading additional SQL modules...
> Executing cscript //NoLogo "C:\Program
> Files\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****"
> "C:\Program Files\PostgreSQL\9.2"
> "D:\_SDB\Database\RDBMS\PostgreSQL\9.2\data" 5432 Script exit code: 2
>
> It exits with code 2, which indicates an error. Perhaps the logs (see
> earlier) say why.
>
>> I'm being recommended to try running pg_dump by Thomas Kellerer, then
>> remove all my data folders and a reinstall. I get the feeling it is
>> not moving my data to the D: drive that has caused the problem, but
>> that the Uninstall has not cleaned this out correctly, as I moved my
>> data to D:/../data_old to enable Postgres to reinstall and used the
>> installation Wizard to point to my data location, but still get
>> installation errors and a connection problem, despite using the 'correct'
> password.
>
> I doubt that the uninstaller would remove your data directory, because then
> you would lose your data. You don't want that, it's generally better to
> leave decisions like that up to the administrator (you). That data is more
> often than not quite valuable ;)
>
>> When I start pgAdmin, TaskManager shows that Postgres is running, -so
>> I don't think I have an unrecoverable database snapshot?
>
> That Postgres appears to be running is encouraging.
>
> Something worth verifying; open a command prompt and type netstat -an and
> look whether the port you configured Postgres to run on is being listened
> on.
>
> If it is, then your issue is just a connection issue. Perhaps you could
> elaborate on what you're doing to connect and what error you receive?
>
> It's possible that you locked yourself out through the pg_hba.conf file or
> that you need to reset the password for the postgres user. But we don't know
> that yet...
>
>
>> -----Original Message-----
>> From: Alban Hertroys [mailto:haramrae@gmail.com]
>> Sent: 31 July 2013 11:48
>> To: Stephen Brearley
>> Cc: 'Adrian Klaver'; pgsql-general@postgresql.org
>> Subject: Re: [GENERAL] Postgres 9.2.4 for Windows (Vista) Dell Vostro
>> 400, re-installation failure PLEASE CAN SOMEONE HELP!!
>>
>> On Jul 31, 2013, at 12:07, "Stephen Brearley"
>> <mail@stephenbrearley.name>
>> wrote:
>>
>>> Both the install and uninstall should work flawlessly. The only thing
>>> I can see is that I have installed the program once before, and I
>>> have put my data on my d: drive to separate it from the program in
>>> case of software problems, but I got Postgresql to correctly find my data
> before..
>>
>>
>> If Postgres is having any issues starting up, details should be in the
>> log file. I don't know where that file gets written on a Windows
>> system though, perhaps it ends up in the Windows Event log?
>>
>> What procedure did you follow to move your data to the D-drive? That
>> seems a likely cause of trouble, especially if the database was
>> running while you did that - you may be looking at an unrecoverable
>> database snapshot if you didn't take precautions, in which case the
>> database would refuse to start up.
>>
>> Alban Hertroys
>> --
>> If you can't see the forest for the trees, cut the trees and you'll
>> find there is no forest.
>>
>> <install-postgresql.log>
>
> Alban Hertroys
> --
> If you can't see the forest for the trees, cut the trees and you'll find
> there is no forest.
>
>

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.