Re: possible problem with version string in win32 port

Lists: pgsql-hackers-win32
From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "PostgreSQL Win32 port list" <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: possible problem with version string in win32 port
Date: 2004-11-02 21:34:17
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3412A7515@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32

On a lark I changed the postgresql version string from 8.0.0beta4 to
8.0.0 in configure, did a full make clean + configure + compile. After
this trying to start the server elicits a version mismatch complaint
from pg_ctl with postmaster.exe. I figure probably a line ending issue,
no big deal (although I have no idea why it works now.)

So, I hack exec.c to do a straight strcmp to a line-ending insensitive
version of the same (aside: this may be a good idea anyways). Still no
luck starting the server. It turns out pg_ctl is trying to compare

postmaster (PostgreSQL) 8.0.0\n <-- on the pg_ctl side
with
postmaster (PostgreSQL) 8.0.\n <-- on the postmaster side, read from
popen with -V switch.

However, postmaster -V from the command line returns the correct version
string.

I further hack my insensitive comparison to subtract one from the
expected string length, and now everything works normally. I checked
all the buffer lengths and everything is within normal limits. Setting
the version string back to 8.0.0 beta4 allows everything to work as
originally coded via a straight strcmp().

Merlin


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: "PostgreSQL Win32 port list" <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: possible problem with version string in win32 port
Date: 2004-11-04 02:33:52
Message-ID: 19874.1099535632@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32

"Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> writes:
> ... It turns out pg_ctl is trying to compare

> postmaster (PostgreSQL) 8.0.0\n <-- on the pg_ctl side
> with
> postmaster (PostgreSQL) 8.0.\n <-- on the postmaster side, read from
> popen with -V switch.

I couldn't reproduce this on Linux. There is Windows-specific code in
pipe_read_line(), which seems like it might be the root of the problem,
but I can't see anything obviously wrong with it.

regards, tom lane