views:

867

answers:

4

I am curious as to why you don't have to use initdb as per the postgresql manual prior to running psql the first time? (I have installed version 8.3 on 8.04.1)

Red Hat requires -c postgresql start but not init.db.

However, on FreeBSD you have to run initdb.

Why isn't setup consistent? Does it come down to a difference between apt-get install, rpm -i and pkg_add ?

+1  A: 

Most likely it's simply that the startup scripts that it's packaged with by those systems automatically run initdb the first time they're run.

Kieron
That's exactly right. Look at /etc/init.d/postgresql
Paul Tomblin
+1  A: 

Almost certainly, yes. Different flavours of Linux and Unix have different approaches to packaging software; FreeBSD, for example, is based off the ports system (where you compile from scratch, although there are binary packages pre-built for much of it), whereas it's often the case in mainstream Linux distributions that you'll find a completely pre-prepared binary package for something popular.

Different people who maintain the packaging systems ("packagers", and other, sometimes less than kind nicknames) maintain different approaches to the problem, often reflecting the parent project's ethos. Alternatively, it may simply be that one packager decides it's reasonable to set things up with a standard configuration and run some common initialisation steps on your behalf, whereas a more hands-off packager will leave it up to the end user, particularly if the software is in any way complicated or requiring any consideration before deployment, e.g. system services.

Rob
A: 

If am not wrong, Ubuntu's PostgreSQL packages are derived from Debian. May be Debian's packaging has this position for some reason. If that's the case, Debian and all it's derivatives like Ubuntu will depict the same behaviour. This will happen only if you try to install the corresponding software from the repository. If you get the source from the PostgreSQL's site and compile it, you will get it as specified in the manual. Various distributions follow certain packaging guidelines and take certain stances with respect to packaging certain softwares. If you want to know exact details, you can poke the package maintainer of the postgresql package to know the reasons.

Technofreak
+1  A: 

Its not the start up scripts, its post install hooks specified in the package that you installed that does extra steps for you. No matter if your using .deb or .rpm format, packagers can set tasks to happen after all of the files have been installed.

Some distributions hold your hand when you install software, some expect that you would prefer to do things on your own.. there really is no golden answer as to why any packager does things the way that they do.

Ubuntu strives for one click effortless installs without the user ever seeing a shell. Other distributions built specifically for system integrators do not hold your hand.

Welcome to the 31 (and more) flavors of operating systems revolving around the Linux kernel, or the efforts focused on the BSD kernel.

Everyone has some idea of how it should be done. Good distributions assume that you know what you're doing .. unless of course they want to pinch the desktop market from Microsoft, in which case they become good desktop distributions that hold your hand.

Its a matter of choice, mostly, which is what makes the whole phenomenon so cool.

Tim Post