Re: Big 7.1 open items

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Jan Wieck <JanWieck(at)Yahoo(dot)com>, Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
Subject: Re: Big 7.1 open items
Date: 2000-06-21 04:33:01
Message-ID: 200006210433.AAA18343@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I recommend making a dbname in each directory, then putting the
> > location inside there.
>
> This still seems backwards to me. Why is it better than tablespace
> directory inside database directory?

Yes, that is what I want too.

>
> One significant problem with it is that there's no longer (AFAICS)
> a "default" per-database directory that corresponds to the current
> working directory of backends running in that database. Thus,
> for example, it's not immediately clear where temporary files and
> backend core-dump files will end up. Also, you've just added an
> essential extra level (if not two) to the pathnames that backends will
> use to address files.
>
> There is a great deal to be said for
> ..../database/tablespace/filename
> where .../database/ is the working directory of a backend running in
> that database, so that the relative pathname used by that backend to
> get to a table is just tablespace/filename. I fail to see any advantage
> in reversing the pathname order. If you see one, enlighten me.

Yes, agreed. I was thinking this:

CREATE TABLESPACE loc USING '/var/pgsql'

does:

ln -s /var/pgsql/dbname/loc data/base/dbname/loc

In this way, the database has a view of its main directory, plus a /loc
subdirectory for the tablespace. In the other location, we have
/var/pgsql/dbname/loc because this allows different databases to use:

CREATE TABLESPACE loc USING '/var/pgsql'

and they do not collide with each other in /var/pgsql. It puts /loc
inside the dbname that created it. It also allows:

CREATE DATABASE loc IN '/var/pgsql'

to work because this does:

ln -s /var/pgsql/dbname data/base/dbname

Seems we should create the dbname and loc directories for the users
automatically in the synlink target to keep things clean. It prevents
them from accidentally having two databases point to the same directory.

Comments?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 2000-06-21 04:45:01 Re: Big 7.1 open items
Previous Message Tom Lane 2000-06-21 04:06:42 Re: Big 7.1 open items

Browse pgsql-patches by date

  From Date Subject
Next Message Chris Bitmead 2000-06-21 04:45:01 Re: Big 7.1 open items
Previous Message Tom Lane 2000-06-21 04:06:42 Re: Big 7.1 open items