Re: Big 7.1 open items - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Big 7.1 open items
Date
Msg-id 200006210345.XAA15107@candle.pha.pa.us
Whole thread Raw
In response to RE: Big 7.1 open items  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses Re: Big 7.1 open items  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
[ Charset ISO-8859-1 unsupported, converting... ]
> > -----Original Message-----
> > From: Peter Eisentraut
> >
> > Bruce Momjian writes:
> >
> > > If we have a new CREATE DATABASE LOCATION command, we can say:
> > >
> > >     CREATE DATABASE LOCATION dbloc IN '/var/private/pgsql';
> > >     CREATE DATABASE newdb IN dbloc;
> >
> > We kind of have this already, with CREATE DATABASE foo WITH LOCATION =
> > 'bar'; but of course with environment variable kludgery. But it's a start.
> >
> > >     mkdir /var/private/pgsql/dbloc
> > >     ln -s /var/private/pgsql/dbloc data/base/dbloc
> >
> > I think the problem with this was that you'd have to do an extra lookup
> > into, say, pg_location to resolve this. Some people are talking about
> > blind writes, this is not really blind.
> >
> > >     CREATE LOCATION tabloc IN '/var/private/pgsql';
> > >     CREATE TABLE newtab ... IN tabloc;
> >
> > Okay, so we'd have "table spaces" and "database spaces". Seems like one
> > "space" ought to be enough.
> 
> Does your "database space" correspond to current PostgreSQL's database ?
> And is it different from SCHEMA ?

OK, seems I have things a little confused.  My whole idea of database
locations vs. normal locations is flawed.  Here is my new proposal.

First, I believe there should be locations define per database, not
global locations.

I recommend 
CREATE TABLESPACE tabloc USING '/var/private/pgsql';CREATE TABLE newtab ... IN tabloc;

and this does:
mkdir /var/private/pgsql/dbnamemkdir /var/private/pgsql/dbname/tabloc    ln -s /var/private/pgsql/dbname/tabloc
data/base/tabloc

I recommend making a dbname in each directory, then putting the
location inside there.

This allows the same directory to be used for tablespaces by several
databases, and allows databases created in locations without making
special per-database locations.

I can give a more specific proposal if people wish.

Comments?

--  Bruce Momjian                        |  http://www.op.net/~candle pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Big 7.1 open items
Next
From: Tom Lane
Date:
Subject: Re: Big 7.1 open items