Re: Tablespace permissions issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Tablespace permissions issue
Date: 2004-06-28 13:59:25
Message-ID: 26185.1088431165@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> 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 goes --- it gets put into the tablespace
that is default for your schema or database. Which is not necessarily
pg_default.

You could possibly argue that pg_default ought to have world permissions
in the default setup, but I don't really see why. Joe User probably
shouldn't be fooling with tablespaces at all.

> I guess that might have been a bit presumptuous but a similar thing
> happens if you don't specify a tablespace:

> tablespaceId = get_namespace_tablespace(namespaceId);
> /* note no permission check on tablespace in this case */

That's not a bug either. The presumption is that whoever assigned a
default tablespace to your schema or database had the right to do so.
Users who just make use of that default don't need any extra
permissions.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-06-28 14:08:31 Re: Tablespace permissions issue
Previous Message Mark 2004-06-28 13:34:05 working on support triggers on columns