Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

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

			regards, tom lane

In response to

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group