X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 4CACB9DC81F for ; Sun, 18 Dec 2005 20:39:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50967-09 for ; Sun, 18 Dec 2005 20:39:15 -0400 (AST) X-Greylist: delayed 00:05:01.153774 by SQLgrey- Received: from rwcrmhc12.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by postgresql.org (Postfix) with ESMTP id 11A599DC8A8 for ; Sun, 18 Dec 2005 20:39:09 -0400 (AST) Received: from [10.0.1.5] (c-24-20-199-254.hsd1.or.comcast.net[24.20.199.254]) by comcast.net (rwcrmhc13) with SMTP id <200512190034110150050hume>; Mon, 19 Dec 2005 00:34:11 +0000 Subject: Re: How to find data directory From: Ken Hill Reply-To: ken@scottshill.com To: Jeff Frost Cc: pgsql-admin@postgresql.org In-Reply-To: References: <1134772264.7276.2.camel@localhost.localdomain> <1134784056.7354.2.camel@localhost.localdomain> Content-Type: text/plain Organization: Scotts Hill Associates, Inc. Date: Sun, 18 Dec 2005 16:34:16 -0800 Message-Id: <1134952457.7555.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.04 required=5 tests=[AWL=0.040] X-Spam-Score: 0.04 X-Spam-Level: X-Archive-Number: 200512/189 X-Sequence-Number: 19909 That works nice. It shows my data directory in '/var/lib/postgresql/7.4/main'. When I do an ls command, I get: $ sudo ls /var/lib/postgresql/7.4/main base pg_clog pg_ident.conf pg_xlog postmaster.opts root.crt global pg_hba.conf PG_VERSION postgresql.conf postmaster.pid I have created two database named 'testdb' and 'csalgorithm'. How do I find these databases? I was expecting the databases to be subdirectories under the database directory (e.g. /var/lib/postresql/7.4/main/testdb and /var/lib/postgresql/7.4/main/csalgorithm). On Fri, 2005-12-16 at 19:34 -0800, Jeff Frost wrote: > Then an easy way is likely to look at the init script that starts it, or use > ps auxwww |grep postmaster to have a look at how it was started. The last > command will likely yield something that looks like this: > > postgres 3026 0.0 0.3 20064 3176 ? S 08:21 0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data > > Which means the data directory is /var/lib/pgsql/data. > > >>> database, but I can find the directory where the database are kept. How > >>> do I find where the postgresql database directory is from a command > >>> line? >