[check_postgres] --dbservice behavior

Cédric Villemain cedric.villemain at dalibo.com
Tue Apr 7 14:53:06 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Cédric Villemain a écrit :
> Hello,
> 
> psql "service=myservice" work only if pg >=8.3.
> 
> I suggest that check_postgres use it the old way :
> 
> PGSERVICE="myservice" psql
> 
> I am not aware if it can break things ...
> 
> I will try to do it (and send a patch if my solution looks fine)
> 
> 

Looks ok for me (what must have precedence ? if PGSERVICE already defined...).
With only *few* test. (as usual, patch against 2.7.3)


- --- bin/check_postgres.pl       2009-04-07 16:31:45.000000000 +0200
+++ check_postgres.pl   2009-04-07 16:49:09.000000000 +0200
@@ -1033,7 +1033,7 @@
                my @args = ('-q', '-t');
                if (defined $db->{dbservice} and length $db->{dbservice}) { ##
XX Check for simple names
                        $db->{pname} = "service=$db->{dbservice}";
- -                       push @args, qq{service=$db->{dbservice}};
+                       $ENV{"PGSERVICE"}="$db->{dbservice}"
                }
                else {
                        $db->{pname} = "port=$db->{port} host=$db->{host}
db=$db->{dbname} user=$db->{dbuser}";




- --
Cédric Villemain
Administrateur de Base de Données
Cel: +33 (0)6 74 15 56 53
http://dalibo.com - http://dalibo.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknbaMoACgkQo/dppWjpEvwM/QCeKO0zWG7CMuEjO9H49OOlUgm9
jfEAn1fCfGjghZf7INbjszsxMDeKzTTL
=e1gF
-----END PGP SIGNATURE-----


More information about the Check_postgres mailing list