Re: [HACKERS] Safer auto-initdb for RPM init script

2006-08-25 Thread Peter Eisentraut
Am Freitag, 25. August 2006 15:19 schrieb Tom Lane:
 I don't really want to remove the auto-initdb feature from the script,
 because it's important not to drive away newbies by making Postgres
 hard to start for the first time.  But I think we'd better think about
 ways to make it more bulletproof.

Why not run initdb in the %post and not in the init script at all?  That 
should be newbie-friendly as well.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Safer auto-initdb for RPM init script

2006-08-25 Thread Magnus Hagander
 I don't really want to remove the auto-initdb feature from the
 script, because it's important not to drive away newbies by making
 Postgres hard to start for the first time.  But I think we'd better
 think about ways to make it more bulletproof.

Why does initdb have to happen on startup? Wouldn't it be much more
logical to do it at install time? (like we do in the win32 installer,
for example, I'm sure there are other examples as well)


//Magnus


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Safer auto-initdb for RPM init script

2006-08-25 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes:
 I don't really want to remove the auto-initdb feature from the
 script, because it's important not to drive away newbies by making
 Postgres hard to start for the first time.  But I think we'd better
 think about ways to make it more bulletproof.

 Why does initdb have to happen on startup? Wouldn't it be much more
 logical to do it at install time?

It eats rather a lot of disk space for a package that might just be
getting loaded as part of a system install, with no likelihood of
actually being used.  In CVS tip a just-initdb'd data directory seems
to be a shade under 30MB, which I guess isn't a huge amount these days
but it compares unfavorably with the installed footprint of the code
itself (postgresql-server RPM looks to be about 4MB).

If this were a bulletproof solution then I'd consider it anyway, but
AFAICS it's got the very same vulnerabilities as the flag-file method,
ie, if you RPM install or upgrade while your mountable data directory
is offline, you can still get screwed.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] Safer auto-initdb for RPM init script

2006-08-25 Thread Peter Eisentraut
Am Freitag, 25. August 2006 16:20 schrieb Tom Lane:
 It eats rather a lot of disk space for a package that might just be
 getting loaded as part of a system install, with no likelihood of
 actually being used.

Wouldn't the system install start the init script at the end of the 
installation process anyway?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Safer auto-initdb for RPM init script

2006-08-25 Thread Gregory Stark

Tom Lane [EMAIL PROTECTED] writes:

 Comments?  Anyone see a better way?

Well the truly bullet-proof mechanism would be to check every data file on
every open. You could have a header with some kind of unique tag generated at
initdb time and the backend could ensure it matches the same tag in the
control flag whenever you open a data file.

That might be too expensive though I don't see data files getting opened all
that frequently. You could do the same thing for free by putting the tag in
the file names though.

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] Safer auto-initdb for RPM init script

2006-08-25 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes:
 Am Freitag, 25. August 2006 16:20 schrieb Tom Lane:
 It eats rather a lot of disk space for a package that might just be
 getting loaded as part of a system install, with no likelihood of
 actually being used.

 Wouldn't the system install start the init script at the end of the 
 installation process anyway?

No, it doesn't.  (The Red Hat RPMs in fact did that ... for about
a week ... until I was told in no uncertain terms that we don't
start unnecessary daemons by default.)

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] Safer auto-initdb for RPM init script

2006-08-25 Thread Peter Eisentraut
Am Freitag, 25. August 2006 16:54 schrieb Tom Lane:
 No, it doesn't.  (The Red Hat RPMs in fact did that ... for about
 a week ... until I was told in no uncertain terms that we don't
 start unnecessary daemons by default.)

Well, there seem to be philosophical differences between the various operating 
systems -- We won't install unnecessary packages. vs. We won't start 
unnecessary daemons in unnecessarily installed packages. -- in which case 
your solution doesn't sound all that bad.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster