postgresql

wrobell wrobell at ite.pl
Wed Jul 17 22:30:13 CEST 2002


On Wed, Jul 17, 2002 at 09:53:45PM +0200, Tomasz Kłoczko wrote:
> On Wed, 17 Jul 2002, wrobell wrote:
> 
> > I have some ideas, which should be discussed.
> > 
> > 1. Multi database cluster solution.
> > 
> > -------- Postgresql docs -----------
> > Before  you  can  do  anything, you  must  initialize  a
> > database  storage area  on  disk. We  call  this a  database
> > cluster.
> > ------------------------------------
> > In other words, database cluster is usually dir/file structure
> > under /var/lib/pgsql. Let's continue. :-]
> > 
> > It is impossible to create Postgresql *clean* multi database cluster
> > solution with PLD, currently. However, as many of us know, it is not
> > the fault of this RDBMS:
> > - every db cluster exists in separate directory
> > - every db cluster is configured with files in db cluster directory
> >   (pg_hba.conf, pg_ident.conf, postgresql.conf)
> > - every postgresql instance has its own pid file
> >   (postmaster.pid)
> > - every postgresql instance has its own postmaster options file
> >   (postmaster.opts)
> > 
> > So, let's simplify /etc/sysconfig/postgresql and /etc/rc.d/init.d/postgresql.
> > 
> > File /etc/sysconfig/postgresql should contain only one variable DATA_DIRS.
> > The variable should contain all db cluster dirs, i.e.
> > 
> >     DATA_DIRS="/var/lib/pgsql1 /var/lib/pgsql2"
> > 
> > All other setting can be set in postgresql.conf and postmaster.opts files
> > in given db cluster directory.
> > 
> > Above gives us init.d file simplification. We can remove all
> > POSTMASTER_OPTIONS stuff and even more.
> > 
> > 2. Default behaviour, when there is no database cluster defined.
> > 
> > Currently, when db cluster is not defined, there is created a default one.
> > 
> > I think it should be changed, so there will be an error message that
> > given db cluster does not exist and exit without any further action.
> > 
> > Comments?
> 
> OK but init scripts must allow work/initialize all in two modes: multi
> cluster and single cluster. It will be good add variable for this in
> /etc/sysconfig/postgresql.
> 
> Some usefull (probably) proposition on implementation level: IMHO instead
> list in /etc/sysconfig/postgresql::DATA_DIRS directories/cluster names
> better will be use subdirctories names in /var/lib/pgsql use as
> cluster names if /etc/sysconfig/postgresql::MULTI_CLUSTER=yes
Let's make it simple. When DATA_DIRS contains only one
directory then it is, as you called it, in single cluster mode.

And my point is that there should be no default db cluster defined.
If admin wants to create db cluster, he does it with initdb
and he has to *configure* it, so it should not be created with
/etc/rc.d/init.d/postgresql script, too.
Creating db cluster should look like:
- create
- configure and add entry to DATA_DIRS
- start
and not:
- add entry to DATA_DIRS (set PG_DATA_DIR as it is now or whatever)
- start (de facto create and no configure (sic!) then start)
Where 'start' means running '/etc/rc.d/init.d/postgresql start' command.

Let's look at cvs by analogy. We do not create default repository, ain't it?

> Where do you want put per cluste confifuration files ?
Look into postgresql.conf in your db cluster dir. Then create
another db cluster with, for example 'initdb -D /var/lib/pgsql_001'
and compare directories. Starting postgresql should be easy with
following commands:

    pg_ctl -D /var/lib/pgsql start      # there is your db cluster, I think
    pg_ctl -D /var/lib/pgsql_001 start  # change port in postgresql.conf!

    wrobell <wrobell at ite.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /mailman/pipermail/pld-devel-en/attachments/20040626/84382318/attachment-0002.bin


More information about the pld-devel-en mailing list