Re: pg_config, pg_service.conf, postgresql.conf ....

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Mark Woodward <pgsql(at)mohawksoft(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config, pg_service.conf, postgresql.conf ....
Date: 2006-02-21 16:15:56
Message-ID: 20060221161556.GJ24481@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 21, 2006 at 11:14:58AM -0500, Mark Woodward wrote:
> > pg_config --sysconfdir
>
> Hmm, that doesn't show up with pg_config --help.

What version are you using? If I type pg_config without argument it
appears in the list.

> pg_service.conf may currently be considered a "client side" utility, but
> it need not only be considered that.
>
> One of my difficulties with PostgreSQL is that there is no "standardized"
> location for where everything is located, i.e. self documenting. If you
> know that "/usr/local/pgsql/etc/pg_service.conf" will contain a list of
> services, that is really awesome. That you can use these services in libpq
> is utterly fantastic, from a development point of view. IMHO that is how
> ALL access to the database should be documented, with the "dbname," port,
> etc. offered in the administrators guide as a we to debug the services
> file.

pg_service.conf has to be for client because it may refer to databases
on other machines. Trusting it as a list of databases o the current
machine is silly.

> This may be helpful to some who are willing to retrofit, but I'm think
> more as a "moving forward" point of view.
>
> OK, maybe pg_service.conf is not the right place for this, and that maybe
> a valid argument, but the mechanics involved would be a great asset to the
> admin. Perhaps pg_servers.conf?

Like I said, perhaps you should look into the Debian package
configuration "postgresql-common". There it has a structure for storing
the config for many different clusters on the same machine. It
remembers the port and such. Here a list of programs it contains:

pg_checksystem
pg_createcluster
pg_ctlcluster
pg_dropcluster
pg_lsclusters
pg_maintenance
pg_upgradecluster

I havn't had the opportunity to look into it much but it looks like
it'll solve what you want. It allows you to configure the user, group,
data dir, socket dir, log file and encoding for each cluster. Each
cluster has a name, and pg_lsclusters would list all clusters on a
machine.

Is this what you're looking for?

http://pdo.debian.net/unstable/misc/postgresql-common

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-02-21 16:16:05 Re: pg_config, pg_service.conf, postgresql.conf ....
Previous Message Mark Woodward 2006-02-21 16:14:58 Re: pg_config, pg_service.conf, postgresql.conf ....