Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 56E8D475F4B for ; Wed, 3 Jul 2002 10:08:56 -0400 (EDT) Mailbox-Line: From sszabo@megazone23.bigpanda.com Wed Jul 3 10:08:56 2002 Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id A2A5E476066 for ; Wed, 3 Jul 2002 09:59:38 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id AE06FD5F7; Wed, 3 Jul 2002 06:59:39 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id A3BFD5C02; Wed, 3 Jul 2002 06:59:39 -0700 (PDT) Date: Wed, 3 Jul 2002 06:59:39 -0700 (PDT) From: Stephan Szabo To: Kris Deugau Cc: Subject: Re: Database directory names In-Reply-To: <3D220647.289BFF3@webhart.net> Message-ID: <20020703065440.Y6689-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-3.5 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT,NO_MX_FOR_FROM version=2.30 X-Spam-Level: X-Archive-Number: 200207/42 X-Sequence-Number: 4728 On Tue, 2 Jul 2002, Kris Deugau wrote: > I'm in the final stages of setting up database access for our domain > hosting customers. The current system is running PostgreSQL 7.0- with > which I haven't met any major problems (other than trying to figure out > how to restrict access to each domain's database- solved). > > However... That box is slated for some major hardware upgrades, and an > update from RedHat 7.0 to 7.3- bringing Postgres up to 7.2. This is not > in and of itself a problem... but one particular attribute of 7.2 has > me very puzzled and concerned. > > In 7.0, each database resided in /var/lib/pgsql/data/base/{database > name}. This appears to have changed in 7.2 to an indecipherable number, > with no apparent relation to the database name. > > I've spent a little time playing with > CREATE DATABASE dbname WITH LOCATION = 'dbpath'; > but it doesn't really suit my needs; I don't want to specify where the > base/ directory goes! I don't need to. I do want to be able to easily > track disk usage on a per-database basis- and while I could just make > note of the directory created when a database is created, it would be > *much* simpler to automate information-generating scripts based on the > database name directly. (Nor do I want to hassle with trying to get > appropriate environment variables set for the postmaster; I *really* > don't want to have to modify the init script.) > > Is this a feature, a bug, or a change related to some other critical > functional capability of Postgres? I haven't found anything else that > meets our requirements here, and I can work around this annoyance if > required- but I'd rather be lazy. ;) Switching to numbers for tables and databases helped a few things (including for tables making it easier to rollback a drop table). There's a contrib item, oid2name which will print out a mapping of directory number to database name. The readme gives an example of using it with du.