BUG #3921: CREATE TABLE / INCLUDING INDEXES fails with permission denied

From: "Andrew Gilligan" <andy(at)tcpd(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3921: CREATE TABLE / INCLUDING INDEXES fails with permission denied
Date: 2008-02-01 16:14:45
Message-ID: 200802011614.m11GEjLg031065@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers


The following bug has been logged online:

Bug reference: 3921
Logged by: Andrew Gilligan
Email address: andy(at)tcpd(dot)net
PostgreSQL version: 8.3.0
Operating system: FreeBSD 4.11
Description: CREATE TABLE / INCLUDING INDEXES fails with permission
denied
Details:

Hi all,

There seems to be an incorrect permission failure if INCLUDING INDEXES
is specified while creating a table, even if the user owns the database.

The example below was run on 8.3.0 cvs, checked out earlier today.
No changes were made to any tablespaces.

template1=# CREATE USER andy PASSWORD 'foo';
CREATE ROLE
Time: 2.350 ms
template1=# CREATE DATABASE test OWNER andy;
CREATE DATABASE
Time: 225.004 ms
template1=# \c test andy
Password for user andy:
You are now connected to database "test" as user "andy".
test=> CREATE TABLE t1 (a int PRIMARY KEY);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for
table "t1"
CREATE TABLE
Time: 25.515 ms
test=> CREATE TABLE t2 (LIKE t1 INCLUDING INDEXES);
ERROR: permission denied for tablespace pg_default
test=> \db+
List of tablespaces
Name | Owner | Location | Access privileges | Description
------------+-------+----------+-------------------+-------------
pg_default | pgsql | | |
pg_global | pgsql | | |
(2 rows)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kris Jurka 2008-02-01 20:45:48 Re: BUG #3894: JDBC DatabaseMetaData.getTables is inconsistently case-sensitive with schema name
Previous Message Adam Hardy 2008-02-01 15:38:36 Re: BUG #3894: JDBC DatabaseMetaData.getTables is inconsistently case-sensitive with schema name

Browse pgsql-hackers by date

  From Date Subject
Next Message A.M. 2008-02-01 16:15:26 Re: FW: bitemporal functionality for PostgreSQL
Previous Message Greg Stark 2008-02-01 16:04:58 Re: Limit changes query plan