[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Best practice for allowing access to a postgres db



Hi!

sean finney [2005-10-01 10:11 -0400]:
> >   --cluster: self-explanatory, defaults to default cluster
> 
> perhaps i'll need to make a modification to dbconfig-common to give
> the admin the choice of cluster?  

Yes, if there are multiple clusters, this should be done. Of course it
isn't necessary if there is only one cluster anyway. If there is only
one cluster, the argument does not need to be specified.

> what would be the best way to detect that, btw?

Currently with "pg_lsclusters". I can add some formatting arguments to
it if necessary, right now there is only the default output:

$ pg_lsclusters
Version Cluster   Port Status Owner    Data directory                     Log file
7.4     test      5433 online postgres /var/lib/postgresql/7.4/test       /var/log/postgresql/postgresql-7.4-test.log
8.0     main      5432 online postgres /var/lib/postgresql/8.0/main       /var/log/postgresql/postgresql-8.0-main.log

Alternatively you can write your own query functions by using the
/usr/share/postgresql-common/PgCommon.pm module (get_versions() and
get_version_clusters() ).

> >   required pg_hba.conf line to stdout and exits with 1. If pg_hba.conf has a
> >   scrambled format that cannot be parsed by pg_*_hba, the scripts exit with 2.
> 
> that would be a helpful feature too, so that again things could be
> handled as intelligently as possible: "sorry, i can't understand the
> file, so you'll have to do this yourself", as opposed to blindly
> pushing forward.

Right, that also allows me to ignore less common features like include
files in the first versions.

Martin

-- 
Martin Pitt              http://www.piware.de
Ubuntu Developer   http://www.ubuntulinux.org
Debian Developer        http://www.debian.org

Attachment: signature.asc
Description: Digital signature


Reply to: