Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PostgreSQL database service starts then stops in windows xp

Posted on 2009-05-04
10
4,819 Views
Last Modified: 2012-05-06
I had no problems with PostgreSQL until my machine started freezing. To combat freezing, I disabled some services and ran a reg cleaner.  I re-enabled the needed services.

When I try to start the postgresql 8.1 service I get the following message without any errors:

"the PostgreSQL Database server 8.1 service on Local Computer Started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."

I created new service with pg_ctl, but I get the same results as above.  What could be causing this problem. Is there anything in the registry that I should check?
0
Comment
Question by:silemone
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 4

Expert Comment

by:thewild
ID: 24296979
Can you run it from the command line ? The command should be something like :
postgres -D "<postgresql data directory>"
You should see errors here if there are any.
0
 
LVL 21

Author Comment

by:silemone
ID: 24297175
When I try to start the service from the command line I get something along the lines of:

"you need to start the service from an underprivileged account"  

Since I was logged on with an account with admin privileges, I logged out and logged into the the new account I created (mentioned above).

Now when I try from command line I get: "FATAL: could not create lock file "postmaster.pid:" Permission Denied"

If I try to start the service from the services list, I get: "Could not start the postgresql8.1 service on the Local Computer.  Error 5: Access is Denied."
0
 
LVL 10

Expert Comment

by:ivanovn
ID: 24298584
Is there anything in the log file that could point you to a problem? How about event viewer?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 4

Expert Comment

by:thewild
ID: 24298974
Seems like this account does not have the right permissions on the data folder.
Make sure this account is the owner of the data folder and its subfolders, and that it has "full control".
0
 
LVL 21

Author Comment

by:silemone
ID: 24298986
Nope. There's nothing in any part of the event viewer related to this.  
Postgres is not generating an error, which is why this problem is not obvious.
When I attempt to start the service from the command line via the 'net' command, i.e., "net.exe servicename start",
I get the following:

The postgresql8.1 service is starting.
The postgresql8.1 service could not be started.

The service did not report an error.

More help is available by typing NET HELPMSG 3534.


Now when I type "Net Helpmsg 3534", I get the following:

The service did not report an error.

Help!
0
 
LVL 10

Expert Comment

by:ivanovn
ID: 24299109
Try changing your logging properties in the postgresql.conf file to see possible errors reported by postmaster on service start.
0
 
LVL 21

Author Comment

by:silemone
ID: 24299189
Logging is set to output to 'stderr'.  Is there more I should do here?


0
 
LVL 4

Accepted Solution

by:
thewild earned 250 total points
ID: 24302013
"Nope. There's nothing in any part of the event viewer related to this."

Well, FATAL: could not create lock file "postmaster.pid:" Permission Denied, this IS something related to this.
Have you checked the permissions ? Just to make sure.
Have you also tried to repair the PostgreSQL installation using the installer ? In add/remove programs, chose "modify", check that the configuration is correct ad launch the installation process.


"Logging is set to output to 'stderr'.  Is there more I should do here?"

Yes, you should also change log_min_messages to "DEBUG5", which is the highest output level.
Starting the service via "net start" will never give you precise errors, your only way to know what's happening is either the error log if you use a service or the command line errors otherwise.

Have you installed PostgreSQL using the win32 installer ?
What you could do to avoid too much debugging pain is to reinstall another instance of postgresql pointing to the same data directory.

Also check that you don't have a postmaster.pid in the data directory. If there is already one, PostgreSQL won't start.
0
 
LVL 22

Expert Comment

by:earth man2
ID: 24302067
You need to allow the new account that you have created write access privileges to the directory where postmaster.pid is to be created ("C:\postgres" ???).   If postmaster.pid exists then delete it...
0
 
LVL 21

Author Closing Comment

by:silemone
ID: 31577629
The problem was indeed a permission problem.  The user created to start the service was did not have access to the postgres data directory.  As soon as I provide write access to the directory, it worked.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Installing Windows XP from USB 10 116
PostGreSQL: Concatinate Date Time into TimeStamp 3 50
Java array passed to SQL where clause 23 87
Windows XP under Hyper-V Server 2016 15 41
Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question