Re: Tablespace permissions issue - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Tablespace permissions issue
Date
Msg-id Pine.LNX.4.58.0406281721110.2127@sablons.cri.ensmp.fr
Whole thread Raw
In response to Re: Tablespace permissions issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Tablespace permissions issue
List pgsql-hackers
Dear Tom,

> BTW, it occurs to me that there's a bug in the current implementation of
> CREATE DATABASE when you change the database's default tablespace.
> [...]
> Now, when looking at the new database's reltablespace column, it will
> appear that that table is in the old database's default tablespace ...
> but that ain't where CREATE DATABASE put it.  Ooops.
>
> Thoughts?

I submitted a patch 3 weeks ago so as to update the namespace ownership
wrt the database owner on the first connexion to a database.

It seems to me that you need just the very same hook for housekeeping
stuff after "create database": that would not avoid the problem, but at
least fix the information before it is used. I'm not sure it is that easy
to check for the table space of a table... But as it is just a newly
created database, maybe we can simply assume that all tables are in the
new database "default" tablespace, so the update is really simple?

It's more a "fix-me later" approach, but it does not look that bad, IMHO.

-- 
Fabien Coelho - coelho@cri.ensmp.fr


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Tablespace permissions issue
Next
From: Tom Lane
Date:
Subject: Re: Tablespace permissions issue