Re: Big 7.1 open items

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Big 7.1 open items
Дата
Msg-id 200006211545.LAA08773@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:
> > 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.
> 
> But they don't collide anyway, because the dbname is already unique.
> Isn't the extra subdirectory a waste?

Not really.  Yes, we could put them all in the same directory, but why
bother.  Probably easier to put them in unique directories per database.
Cuts down on directory searches to open file, and allows 'du' to return
meaningful numbers per database.  If you don't do that, you can't really
tell what files belong to which databases.

> 
> Because table files will have installation-wide unique names, there's
> no really good reason to have either level of subdirectory; you could
> just make
>     CREATE TABLESPACE loc USING '/var/pgsql'
> do
>     ln -s /var/pgsql data/base/dbname/loc 
> and it'd still work even if multiple DBs were using the same tablespace.
> 
> However, forcing creation of a subdirectory does give you the chance to
> make sure the subdir is owned by postgres and has the right permissions,
> so there's something to be said for that.  It might be reasonable to do
>     mkdir /var/pgsql/dbname
>     chmod 700 /var/pgsql/dbname
>     ln -s /var/pgsql/dbname data/base/dbname/loc 

Yes, that is true.  My idea is that they may want to create loc1 and
loc2 which initially point to the same location, but later may be moved.
For example, one tablespace for tables, another for indexes.  They may
initially point to the same directory, but later be split.  Seems we
need to keep the actual tablespace information relivant by using
different directories on the other end too.


--  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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Big 7.1 open items]
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: AW: Big 7.1 open items