2

My firewall is down and when I tried to start the Postgres service it gave me an error that said: the service started and then stopped. Some services stop automatically if they are not in use by other services or programs.

I need to start postgres for pgadmin and when I tried to connect to pgadmin it gave me an error that I've seen before but none of those conditions of the error is true because it worked right before my computer was automatically restarted.

I honestly didn't want to change my conf file and simply do it from the pgadmin postgres.conf gui.

The console also gave me an error about a line that had debug assertions =, which I put a hash mark to the left of which got rid of the error.

When I try to run postgres from the command prompt it gives me that postgresql.conf contains errors? But what errors would they be?

I also tried running from the console a couple of different ways and one of the errors I got was pg_ctl: could not start service "postgresql-9.2": error code 1063

enter image description here enter image description here enter image description here

5
  • 3
    Can you post the text of the errors? I take it you're on Windows?
    – R.K.
    Commented Dec 21, 2012 at 15:06
  • yes, well the problem is that I can't copy and paste the errors as they are in separate windows
    – Carl Carlson
    Commented Dec 21, 2012 at 15:23
  • Have you modified postgresql.conf? If so, what about using the backup you made before modifying?
    – Jay Laura
    Commented Dec 21, 2012 at 16:51
  • I didn't make a backup. I basically just placed a hashmark to the left of debug assertions.
    – Carl Carlson
    Commented Dec 21, 2012 at 17:07
  • what's on line 574? And I'm pretty sure you shouldn't use both double and single quotes for the log_line_prefix. Try removing the double quotes from line 392
    – user1822
    Commented Dec 21, 2012 at 23:36

3 Answers 3

3
  1. Start by commenting out the offending line in your postgresql.conf and retry. It is possible that a change made some time ago caused this problem and you are only now seeing it because a reload operation or similar failed, and so PostgreSQL was running on old configuration. If that works address what you have on that line (maybe get rid of the quotes?)

  2. If that doesn't work, take a look elsewhere in the file. Maybe you have an unterminated quote somewhere?

It really looks to me like you have a bad postgresql.conf file and that's why it isn't starting.

2
  • Well I did a comparison between the line when it worked and when it didn't and there is no difference. I also didn't perform any manual changes. I checked all the quotes. Commented Jan 22, 2013 at 19:23
  • Right, but the error message pretty clearly implicates the postgresql.conf so that is really where you need to be troubleshooting. If the file hasn't changed in a while and the computer hasn't been restarted in a while it is quite possible that a reload event failed, and the changes to the postgresql.conf that caused the problem just didn't take effect. So start there. If you can reproduce the problem even after commenting everything out of the conf file, then it is time to look elsewhere, but not until then. Commented Jan 23, 2013 at 5:58
3

It seems that postgresql doesn't like your postgresql.conf file. The log message clearly says that it wasn't expecting a " character on line 392, but it doesn't tell you which one (of two " on this line) is it.

I would assume that there is an unclosed " earlier in the config file.

1
  • This worked for me. I reverted back the changes done in pg_hba.conf and it restarted!
    – Gsv
    Commented Jul 23, 2014 at 8:29
0

I had a similar problem which I resolved by going to the Postgres service in Computer management. In the properties for the Postgres service, Click on the tab 'Log On' and select 'Local System account' then Restart the Postgres service.

1
  • no, unfortunately that didn't work as it gave me an error that said: the service started and then stopped. Some services stop automatically if they are not in use by other services or programs. To restart it, it would have to allow me to start it first.
    – Carl Carlson
    Commented Dec 21, 2012 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.