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

From Tom Lane
Subject Re: Big 7.1 open items
Date
Msg-id 4283.961600040@sss.pgh.pa.us
Whole thread Raw
In response to Re: Big 7.1 open items  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Big 7.1 open items
List 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?

Because table files will have installation-wide unique names, there's
no really good reason to have either level of subdirectory; you could
just makeCREATE TABLESPACE loc USING '/var/pgsql'
doln -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 domkdir /var/pgsql/dbnamechmod 700
/var/pgsql/dbnameln-s /var/pgsql/dbname data/base/dbname/loc 
 
        regards, tom lane


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: AW: Big 7.1 open items
Next
From: Bruce Momjian
Date:
Subject: Re: Big 7.1 open items