X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 55A189F9EEB for ; Tue, 23 May 2006 02:28:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 99769-01 for ; Tue, 23 May 2006 02:28:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from matrix.gatewaynet.com (host2.dynacom.ondsl.gr [62.103.35.210]) by postgresql.org (Postfix) with ESMTP id E4E0D9F9CAA for ; Tue, 23 May 2006 02:28:32 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id k4N5dAew000487; Tue, 23 May 2006 08:39:10 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id k4N5dAUr000483; Tue, 23 May 2006 08:39:10 +0300 Date: Tue, 23 May 2006 08:39:10 +0300 (EEST) From: Achilleus Mantzios To: Mark Fenbers cc: pgsql-sql@postgresql.org Subject: Re: Does PG have a database In-Reply-To: <4471E6B9.9080002@noaa.gov> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/173 X-Sequence-Number: 25204 O Mark Fenbers έγραψε στις May 22, 2006 : > I have working PostgreSQL databases on 3 of my ~30 Linux boxes. I want > my software to be able to determine which of my 30 boxes have functional > databases on them. Since Pg is part of the baseline distro, merely > checking for the existence of an executable doesn't solve my problem. > > I tried looping through my list of hosts and running the command: > psql -h $host --list > but this fails on a box with a database with the same error code as on a > box that doesn't have a database, if my PGUSER isn't set and my login ID > is not the username of the database. The PGUSER setting might differ > for each host, so specifying this in the software is not practical. > > Bottom line: What trick can I use to determine whether a box has a > living, breathing Pg database if I don't know the DB owner? Use a net mgmt tool (like opennms). netcat, telnet to 5432, etc... > > Mark > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > -- -Achilleus