Re: [HACKERS] Happy column dropping - Mailing list pgsql-hackers

From Ross J. Reedstrom
Subject Re: [HACKERS] Happy column dropping
Date
Msg-id 20000125103711.B423@rice.edu
Whole thread Raw
In response to Re: [HACKERS] Happy column dropping  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
On Tue, Jan 25, 2000 at 09:14:29AM -0500, Bruce Momjian wrote:
> > On Mon, 24 Jan 2000, Bruce Momjian wrote:
> > 
> > > New file name will not be just oid.  Too hard to administer.
> > 
> 
> Ingres has table names as numbered files.  It is a pain to figure out
> which files match which tables.  If you need to restore a table from
> tape, the pg_class entry is gone and you have no way to figure out the
> right table.  When analyzing disk space, figuring who is using the space
> is a pain.
> 

Hmm, how about a map file, of conventional name, kept in the pgsql/data
dir, that contains filename -> db/tablename mappings? It would be
essentially a pretty printed dump of pg_class. That way, the admin
has access to the mapping even when the postmaster is down. Even to
restore from tape: grab pg_class_map from the tape (you did dump it
to the beginning, right?) and then grab the file you need. I don't see
this as being a particularly large file, in any case, and DDL isn't a
speed critical path, so rewriting the pg_class_map file wouldn't hurt.
And, since it's just for human/admin consumption, so major problem if
it gets out of sync: just regenerate it from pg_class. Could even be
used to sanity check the DBMS on start up: generate a new pg_class_map,
compare it to the old: if they don't match, fire a warning/die?

I'd suggest a format that's easily machine by awk/sed/grep (perl, etc.)
for those db admin tasks Bruce is talking about (space, etc.) Heck, 
it'd be easy to whip up a 'generate a bunch of symlinks' script
to get the tablenames back, if you really need them.

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>          Tel. 713-348-6166
NSBRI Research Scientist/Programmer                    Fax  713-348-6182
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: Re: [HACKERS] Happy column dropping
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Happy column dropping