From: Tom Lane <tgl@sss.pgh.pa.us>
To: Saltsgaver, Scott <scottsa@aiinet.com>
Cc: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: Granting of permissions on tables
Date: Fri, 06 Oct 2000 11:07:05 -0400
Message-ID: <25420.970844825@sss.pgh.pa.us> (raw)
In-Reply-To: <7283DE19D141D111AD0E00A0C95B195503A59E74@mail2.aiinet.com>
References: <7283DE19D141D111AD0E00A0C95B195503A59E74@mail2.aiinet.com>
"Saltsgaver, Scott" <scottsa@aiinet.com> writes:
> After I ran into this condition, the first thing I tried was to grant
> permissions back to myself. PostgreSQL shot me down with a permission
> denied error. So I had to log is as the superuser and then grant
> permissions to myself.
Are you sure about that? What version are you running? I get
play=> select version();
version
------------------------------------------------------------------
PostgreSQL 7.0.2 on hppa2.0-hp-hpux10.20, compiled by gcc 2.95.2
(1 row)
play=> select usename, usesuper from pg_user;
usename | usesuper
----------+----------
postgres | t
tgl | f
tree | f
(3 rows)
play=> select current_user;
getpgusername
---------------
tgl
(1 row)
play=> create table bar (f1 int);
CREATE
play=> select * from bar;
f1
----
(0 rows)
play=> grant all on bar to tree;
CHANGE
play=> select * from bar;
ERROR: bar: Permission denied.
play=> grant all on bar to tgl;
CHANGE
play=> select * from bar;
f1
----
(0 rows)
play=>
AFAICT from both experiment and looking at the sources, a table
owner is allowed to change the table's access permissions whether
or not he's currently got any permissions granted to himself;
ie, changing permissions is not a grantable/revokable right,
it's just checked on the basis of who you are.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, scottsa@aiinet.com
Subject: Re: Granting of permissions on tables
In-Reply-To: <25420.970844825@sss.pgh.pa.us>
References: <7283DE19D141D111AD0E00A0C95B195503A59E74@mail2.aiinet.com> <25420.970844825@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox