Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 50EE6632BCF for ; Tue, 10 Aug 2010 16:57:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 64387-02 for ; Tue, 10 Aug 2010 19:57:27 +0000 (UTC) X-Greylist: delayed 00:19:56.73785 by SQLgrey-1.7.6 Received: from hedwig.simons-rock.edu (hedwig.simons-rock.edu [208.81.88.14]) by mail.postgresql.org (Postfix) with ESMTP id 10281632BBB for ; Tue, 10 Aug 2010 16:57:28 -0300 (ADT) Received: from [10.30.2.208] (d2h208.sta-fac.simons-rock.edu [10.30.2.208]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hedwig.simons-rock.edu (Postfix) with ESMTP id 1A1BD2BB34A; Tue, 10 Aug 2010 15:37:28 -0400 (EDT) Message-ID: <4C61AA77.1040606@simons-rock.edu> Date: Tue, 10 Aug 2010 15:37:27 -0400 From: charlie derr User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Kasia Tuszynska CC: "pgsql-admin@postgresql.org" Subject: Re: postgres function does not handle PUBLIC - expected? References: <232B5217AD58584C87019E8933556D110211D1AE9F@redmx2.esri.com> <26083_1281468417_4C61A800_26083_177_1_232B5217AD58584C87019E8933556D110211D1AEDA@redmx2.esri.com> In-Reply-To: <26083_1281468417_4C61A800_26083_177_1_232B5217AD58584C87019E8933556D110211D1AEDA@redmx2.esri.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/77 X-Sequence-Number: 35326 Kasia Tuszynska wrote: > Szymon, > > The PUBLIC role is a default, non login role, that is created with every > postgres cluster/instance. > > To my knowledge PUBLIC is a standard user in any rdbms. So, existence > of public is not the issue here. > > Sincerely, > > Kasia > Kasia, I think your assumption is wrong. I've been using postgres for a lot of years and never saw a PUBLIC role created by default in all the installations I've ever done. It's certainly possible that various other RDBMSs may assume the existence of such a role/user, but my experience is that the only default role in "our world" is named postgres. So I think this does have everything to do with your issue. Why don't you give it a shot and try to create a user named PUBLIC? good luck, ~c > > > *From:* Szymon Guz [mailto:mabewlun@gmail.com] > *Sent:* Tuesday, August 10, 2010 12:11 PM > *To:* Kasia Tuszynska > *Cc:* pgsql-admin@postgresql.org > *Subject:* Re: [ADMIN] postgres function does not handle PUBLIC - expected? > > > > 2010/8/10 Kasia Tuszynska > > > Hello Postgres Gurus, > > > > Is it expected behavior for the has_table_privilege postgres function to > not handle the user PUBLIC? Or should I submit a bug? > > > > The has_table_privilege function does not handle PUBLIC – the following > queries returns the error: > > SELECT has_table_privilege ('PUBLIC','bob.gdb.test1','SELECT') AS SELECT, > > has_table_privilege ('PUBLIC','bob.gdb.test1','INSERT') AS INSERT, > > has_table_privilege ('PUBLIC','bob.gdb.test1','DELETE') AS DELETE, > > has_table_privilege ('PUBLIC','bob.gdb.test1','UPDATE') AS UPDATE; > > > > ERROR: role "PUBLIC" does not exist > > SQL state: 42704 > > > > SELECT has_table_privilege ('public','bob.gdb.test1','SELECT') AS SELECT, > > has_table_privilege ('public','bob.gdb.test1','INSERT') AS INSERT, > > has_table_privilege ('public','bob.gdb.test1','DELETE') AS DELETE, > > has_table_privilege ('public','bob.gdb.test1','UPDATE') AS UPDATE; > > > > ERROR: role "public" does not exist > > SQL state: 42704 > > Thank you, > > Sincerley, > > Kasia > > > > Do you have any role that is named PUBLIC? I think that you don't have > one. Check e.g. in the table pg_user. > > > > regards > > Szymon >