Skip site navigation (1) Skip section navigation (2)

pg_ctl

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-hackers-win32 <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: pg_ctl
Date: 2003-12-01 17:47:29
Message-ID: 3FCB7EB1.2070609@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers-win32
I briefly reviewed the alpha version of this that Joshua posted a URL to 
(after converting all the c++ style comments and running through 
pgindent so I could read it).

I endorse Neil's and Bruce's comments. In addition, I noticed these things:

. on Win32 a start op is guaranteed to hang unless I'm misreading the 
code, as it is not backgrounded. Calling system() won't work here - I 
think we'll have to call CreateProcess() on Win32.
. what about devnull processing on Win32?
. multi-line literals are apparently illegal (see recent hackers 
thread?) and rejected by some compilers - use the fact that the compiler 
will concatentate adjacent string literals.
. there is a lot of incorrect code that tries to do things that are 
already done correctly and portably in initdb.c - e.g. finding the 
postmaster executable.
. calling fopen() to check existence of a file is, er, suboptimal. Use 
stat().
. no error checking on malloc() calls
. calling free() on these tiny strings is quite unnecessary - the 
program should use minimal memory and have a very short life span. It's 
just useless clutter IMNSHO.

This isn't an exhaustive list.

I suspect this work is actually a bit premature, and would best be done 
after we have a working Win32 postmaster. After all, you can happily run 
postgres without ever calling pg_ctl - it's a convenience rather than an 
absolute necessity (unlike initdb). On Windows, production users 
probably wouldn't use it at all - they would use the service manager, I 
should think.

cheers

andrew





Responses

  • Re: pg_ctl at 2003-12-01 23:54:38 from Joshua D. Drake
  • Re: pg_ctl at 2004-03-24 15:54:02 from Andrew Dunstan

pgsql-hackers-win32 by date

Next:From: Joshua D. DrakeDate: 2003-12-01 23:54:38
Subject: Re: pg_ctl
Previous:From: Claudio NatoliDate: 2003-12-01 08:58:04
Subject: Re: fork/exec

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group