Re: [GENERAL] initdb and exit_nicely...

2000-05-25 Thread Peter Eisentraut
Tom Lane writes: The idea I suggested a couple of days ago was that initdb should refuse to run if PGDATA exists and is nonempty. Sound reasonable? Okay, let's do that. How do you find out if a directory is empty? The best way I could think of is this: test x"`ls -A "$PGDATA"`" = x Are we

Re: [GENERAL] initdb and exit_nicely...

2000-05-25 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: How do you find out if a directory is empty? Good question. The best way I could think of is this: test x"`ls -A "$PGDATA"`" = x The embedded quotes might confuse some shells, no? Perhaps better CONTENTS=`ls -A "$PGDATA"` if test

Re: [GENERAL] initdb and exit_nicely...

2000-05-18 Thread Len Morgan
A slightly more reasonable example is where the admin has already inserted his own pg_hba.conf in the directory; would be nice if initdb didn't overwrite it (nor delete it on failure), but I'm not sure it's worth the trouble. I am inclined to leave it as is too. I can imagine many bug

Re: [GENERAL] initdb and exit_nicely...

2000-05-18 Thread Jeffery Collins
Tom Lane wrote: Peter Eisentraut [EMAIL PROTECTED] writes: It seems like it would be a whole lot "nicer" if initdb only deleted the files that it attempted to create OR if the default was not to delete anything. Okay, I could go for the former. What do others think? It'd be a bit of

Re: [GENERAL] initdb and exit_nicely...

2000-05-18 Thread Tom Lane
"Len Morgan" [EMAIL PROTECTED] writes: The reason that IMHO this deserves a little consideration (i.e., doing it at all rather than just saying "Don't store any files in PG_DATA") is that RedHat based rpm installations create the postgres superuser account as part of the process and set the

[GENERAL] initdb and exit_nicely...

2000-05-17 Thread Jeffery Collins
I believe there is a bug, or at least a not very nice feature in initdb. If initdb does not succeed, it attempts to "exit_nicely". By default this involved deleting the $PGDATA directory!! So if you have put other things in you $PGDATA directory or (as in my case) you attempt to create a

Re: [GENERAL] initdb and exit_nicely...

2000-05-17 Thread Peter Eisentraut
Jeffery Collins writes: It seems like it would be a whole lot "nicer" if initdb only deleted the files that it attempted to create OR if the default was not to delete anything. Okay, I could go for the former. What do others think? -- Peter Eisentraut Sernanders väg 10:115

Re: [GENERAL] initdb and exit_nicely...

2000-05-17 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: It seems like it would be a whole lot "nicer" if initdb only deleted the files that it attempted to create OR if the default was not to delete anything. Okay, I could go for the former. What do others think? It'd be a bit of a pain but I can see

Re: [GENERAL] initdb and exit_nicely...

2000-05-17 Thread Bruce Momjian
A slightly more reasonable example is where the admin has already inserted his own pg_hba.conf in the directory; would be nice if initdb didn't overwrite it (nor delete it on failure), but I'm not sure it's worth the trouble. I am inclined to leave it as is too. I can imagine many bug