Re: Big 7.1 open items

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Big 7.1 open items
Дата
Msg-id 200006210433.AAA18343@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Big 7.1 open items  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Big 7.1 open items  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.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@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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Big 7.1 open items
Следующее
От: Chris Bitmead
Дата:
Сообщение: Re: Big 7.1 open items