Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by hub.org (8.10.1/8.10.1) with ESMTP id e96F7GJ47647 for ; Fri, 6 Oct 2000 11:07:16 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.0/8.11.0) with ESMTP id e96F76B25423; Fri, 6 Oct 2000 11:07:10 -0400 (EDT) To: "Saltsgaver, Scott" cc: "'pgsql-sql@postgresql.org'" Subject: Re: Granting of permissions on tables In-reply-to: <7283DE19D141D111AD0E00A0C95B195503A59E74@mail2.aiinet.com> References: <7283DE19D141D111AD0E00A0C95B195503A59E74@mail2.aiinet.com> Comments: In-reply-to "Saltsgaver, Scott" message dated "Fri, 06 Oct 2000 09:25:15 -0400" Date: Fri, 06 Oct 2000 11:07:05 -0400 Message-ID: <25420.970844825@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200010/75 "Saltsgaver, Scott" 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