Thread: DANGER Windows version might hurt you

DANGER Windows version might hurt you

From
Andreas
Date:
I want to warn you all that you might hurt yourself by banging your head
against the wall or damage your karma by using foul language if you find
your postmaster rejecting to work after a minor change in the
postgresql.conf. (I changed the listenig address to an IP instead of *.)
Windows can't start the service anymore but says the program (Postgres)
didn't issue an error message.
Postgres doesn't write a logfile either.

After a long and thorough head scratching while staring at the config I
logged in as "postgres" and startet postmaster directly on the console.
Now it said "syntax error in file ...postgres.conf in line 322" or
something similar.

Line 322 was the last one and was a comment.
So I suspected the lines before it which looked reasonably OK, too.

After trying the sensible solutions I went via the improbaple to the
ridiculous and there it was.
My editor strips empty  lines at the end of a textfile and sets EOF
right after the last visible character so it dumps the CRLF of the last
line and even though it was a comment Postmaster complaines about a
syntax error and goes on strike.

This should be mentioned in the FAQ if it isn't already.




Re: DANGER Windows version might hurt you

From
"Magnus Hagander"
Date:
> I want to warn you all that you might hurt yourself by
> banging your head against the wall or damage your karma by
> using foul language if you find your postmaster rejecting to
> work after a minor change in the postgresql.conf. (I changed
> the listenig address to an IP instead of *.) Windows can't
> start the service anymore but says the program (Postgres)
> didn't issue an error message.
> Postgres doesn't write a logfile either.

Did you check the eventlog? It's supposed to write it there..

If it didn't, what version are you on?


> Line 322 was the last one and was a comment.
> So I suspected the lines before it which looked reasonably OK, too.
>
> After trying the sensible solutions I went via the improbaple
> to the ridiculous and there it was.
> My editor strips empty  lines at the end of a textfile and
> sets EOF right after the last visible character so it dumps
> the CRLF of the last line and even though it was a comment
> Postmaster complaines about a syntax error and goes on strike.
>
> This should be mentioned in the FAQ if it isn't already.

Hmm. It isn't. And it probably should, yes - or the parser should be
fixed to deal with it.

Does this affect win32 only, or unix as well? Anybody know?

//Magnus

Re: DANGER Windows version might hurt you

From
Andreas
Date:
Magnus Hagander schrieb:

>Did you check the eventlog? It's supposed to write it there..
>
>
Well, you are right.   =8-}
There is "FATAL:  Syntaxfehler in Datei
»[...]/PostgreSQL-8.0.3/postgresql.conf«, Zeile 322, bei »#«"
That's the error message I got on the console.
I'm by far no Windows guru and the eventlog ... you know ... ;)
But still, it doesn't say anything about premature EOF or something.
Instead it rises a syntaxerror on a comment line.

>Hmm. It isn't. And it probably should, yes - or the parser should be
>fixed to deal with it.
>
>
pg_hba.conf isn't affected with this issue so it wasn't the first
thought that came to my mind and for a newbie this would be a complete
show-stopper, I'm afraid. I was just lucky to fgure it out since
obviously I had no backup  postgresql.conf .  ;)


Re: DANGER Windows version might hurt you

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
>> My editor strips empty  lines at the end of a textfile and
>> sets EOF right after the last visible character so it dumps
>> the CRLF of the last line and even though it was a comment
>> Postmaster complaines about a syntax error and goes on strike.

> Hmm. It isn't. And it probably should, yes - or the parser should be
> fixed to deal with it.

It sounds like a simple oversight in the flex rules for postgresql.conf.
I'll look into it after feature freeze if no one beats me to it.

            regards, tom lane