pg_ctl
От | Andrew Dunstan |
---|---|
Тема | pg_ctl |
Дата | |
Msg-id | 3FCB7EB1.2070609@dunslane.net обсуждение исходный текст |
Ответы |
Re: pg_ctl
Re: pg_ctl |
Список | 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
В списке pgsql-hackers-win32 по дате отправления: