Re: [HACKERS] Tablespace permissions issue

2004-06-29 Thread Fabien COELHO
Dear Tom, > Fabien COELHO <[EMAIL PROTECTED]> writes: > > It's more a "fix-me later" approach, but it does not look that bad, IMHO. > > It seems a bit risky to me. The worst possible consequence of the > ownership stuff not happening is that objects have wrong ownership (and > even there it's no

Re: [HACKERS] Tablespace permissions issue

2004-06-28 Thread Gavin Sherry
On Mon, 28 Jun 2004, Tom Lane wrote: > I don't see any reasonable way for CREATE DATABASE to avoid this > problem, since it can't necessarily look inside the source database. > My thought is that the cleanest fix is to never allow reltablespace > (or nsptablespace) to explicitly specify the databa

Re: [HACKERS] Tablespace permissions issue

2004-06-28 Thread Tom Lane
Fabien COELHO <[EMAIL PROTECTED]> writes: > It's more a "fix-me later" approach, but it does not look that bad, IMHO. It seems a bit risky to me. The worst possible consequence of the ownership stuff not happening is that objects have wrong ownership (and even there it's not so much "wrong" as "w

Re: [HACKERS] Tablespace permissions issue

2004-06-28 Thread Fabien COELHO
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 table

Re: [HACKERS] Tablespace permissions issue

2004-06-28 Thread Tom Lane
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. The CREATE DATABASE code assumes that it can physically copy all content of the old-database's-default-tablespace into the new-database's-default-tablespace, r

Re: [HACKERS] Tablespace permissions issue

2004-06-28 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > That way, an admin can force users to NOT use the default tablespace if > they wish, even though the users have CREATE table rights on the schema. I think the above statement is nonsensical. Perhaps you are confusing the notions of "default t

Re: [HACKERS] Tablespace permissions issue

2004-06-28 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > Chris KL just raised an issue on IRC: > test=> create table test (a int4) tablespace pg_default; > ERROR: permission denied for tablespace pg_default This is not a bug. If you don't have tablespace permissions, you don't get to specify where your table

Re: [HACKERS] Tablespace permissions issue

2004-06-28 Thread Christopher Kings-Lynne
This wasn't encountered in my original patch because pg_tablespace_aclmask() had this test reasonably early on: + if(tbloid == DEFAULTTBLSPC) + return (mask); I guess that might have been a bit presumptuous but a similar thing happens if you don't specify a tablespace: tablespaceId

[HACKERS] Tablespace permissions issue

2004-06-27 Thread Gavin Sherry
Chris KL just raised an issue on IRC: test=> create table test (a int4) tablespace pg_default; ERROR: permission denied for tablespace pg_default This wasn't encountered in my original patch because pg_tablespace_aclmask() had this test reasonably early on: + if(tbloid == DEFAULTTBLSPC) +