Re: [PATCHES] initdb in C

2003-11-10 Thread Bruce Momjian
Patch applied. We now have a C version of initdb! --- Andrew Dunstan wrote: > > > Bruce Momjian wrote: > > >Here is a slightly modified version of Andrew's great work in making a C > >version of initdb. Other than minor

Re: [PATCHES] initdb in C

2003-11-08 Thread Andrew Dunstan
Bruce Momjian wrote: Also, I see this at the top of the code: * author: Andrew Dunstan mailto:[EMAIL PROTECTED] * * Copyright (C) 2003 Andrew Dunstan * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyrigh

Re: [PATCHES] initdb in C

2003-11-08 Thread Andrew Dunstan
Tom Lane wrote: Bruce Momjian <[EMAIL PROTECTED]> writes: Consider also the strong likelihood that the data directory's parent directory is owned by root, Again, this directory recreate happens only on Win32, an I thought it would be OK there. Windows has no concept of director

Re: [PATCHES] initdb in C

2003-11-08 Thread Bruce Momjian
Also, I see this at the top of the code: * author: Andrew Dunstan mailto:[EMAIL PROTECTED] * * Copyright (C) 2003 Andrew Dunstan * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of t

Re: [PATCHES] initdb in C

2003-11-08 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Recreating the directory only happens on WIN32, where rmdir doesn't > > allow you to only delete files and subdirectories and not the parent > > directory. Non-Win32 does rm -rf dir/*. > > I think we should forget about invoking rm a

Re: [PATCHES] initdb in C

2003-11-08 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > >> Consider also the strong likelihood that the data directory's parent > >> directory is owned by root, > > > Again, this directory recreate happens only on Win32, an I thought it > > would be OK there. > > Windows has no concept of d

Re: [PATCHES] initdb in C

2003-11-08 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Recreating the directory only happens on WIN32, where rmdir doesn't > allow you to only delete files and subdirectories and not the parent > directory. Non-Win32 does rm -rf dir/*. I think we should forget about invoking rm as a subprocess at all, and j

Re: [PATCHES] initdb in C

2003-11-08 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: >> Consider also the strong likelihood that the data directory's parent >> directory is owned by root, > Again, this directory recreate happens only on Win32, an I thought it > would be OK there. Windows has no concept of directory permissions at all? I

Re: [PATCHES] initdb in C

2003-11-08 Thread Bruce Momjian
Peter Eisentraut wrote: > Andrew Dunstan writes: > > > recreating the datadir if we didn't create it initially should be OK in > > that case, and it makes the code simpler. > > That should be avoided, because you'll have trouble recreating the > original directory with all its properties such as

Re: [PATCHES] initdb in C

2003-11-08 Thread Bruce Momjian
Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > Andrew Dunstan writes: > >> recreating the datadir if we didn't create it initially should be OK in > >> that case, and it makes the code simpler. > > > That should be avoided, because you'll have trouble recreating the > > origina

Re: [PATCHES] initdb in C

2003-11-08 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Andrew Dunstan writes: >> recreating the datadir if we didn't create it initially should be OK in >> that case, and it makes the code simpler. > That should be avoided, because you'll have trouble recreating the > original directory with all its prope

Re: [PATCHES] initdb in C

2003-11-08 Thread Peter Eisentraut
Andrew Dunstan writes: > recreating the datadir if we didn't create it initially should be OK in > that case, and it makes the code simpler. That should be avoided, because you'll have trouble recreating the original directory with all its properties such as ownership, permissions, etc., at least

Re: [pgsql-hackers-win32] [PATCHES] initdb in C

2003-11-08 Thread Bruce Momjian
Andrew Dunstan wrote: > > > Bruce Momjian wrote: > > >Yes, I was concerned too that everything was in there. I checked the > >initdb.sh logs and found that the only thing not added was the checking > >of the max number of connections before checking the max number of > >buffers, which I added.

Re: [pgsql-hackers-win32] [PATCHES] initdb in C

2003-11-08 Thread Andrew Dunstan
Bruce Momjian wrote: Yes, I was concerned too that everything was in there. I checked the initdb.sh logs and found that the only thing not added was the checking of the max number of connections before checking the max number of buffers, which I added. The other stuff was in there. I also che

Re: [pgsql-hackers-win32] [PATCHES] initdb in C

2003-11-08 Thread Bruce Momjian
Andrew Dunstan wrote: > > > Tom Lane wrote: > > >Bruce Momjian <[EMAIL PROTECTED]> writes: > > > > > >>It passes all the regression tests. I have also included a diff against > >>Andrew's version so you can see my changes. It seems Andrew had a very > >>current version of initdb. The only u

Re: [PATCHES] initdb in C

2003-11-08 Thread Andrew Dunstan
Bruce Momjian wrote: Here is a slightly modified version of Andrew's great work in making a C version of initdb. Other than minor cleanups, the only big change was to remove rmdir handling because we using rm -r and rmdir /s in commands/dbcommands.c, so we might as use the same thing for initdb

Re: [PATCHES] initdb in C

2003-11-08 Thread Andrew Dunstan
Bruce Momjian wrote: It passes all the regression tests. I have also included a diff against Andrew's version so you can see my changes. It seems Andrew had a very current version of initdb. The only update he missed was the change to test the number of connections before shared buffers --- I

Re: [PATCHES] initdb in C

2003-11-08 Thread Andrew Dunstan
Tom Lane wrote: Bruce Momjian <[EMAIL PROTECTED]> writes: It passes all the regression tests. I have also included a diff against Andrew's version so you can see my changes. It seems Andrew had a very current version of initdb. The only update he missed was the change to test the number of

Re: [PATCHES] initdb in C

2003-11-07 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > It passes all the regression tests. I have also included a diff against > Andrew's version so you can see my changes. It seems Andrew had a very > current version of initdb. The only update he missed was the change to > test the number of connections b