Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E5B44633047 for ; Tue, 10 Aug 2010 16:35:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 93882-10 for ; Tue, 10 Aug 2010 19:34:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 38CE7633032 for ; Tue, 10 Aug 2010 16:34:53 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 9B54E348040; Tue, 10 Aug 2010 12:34:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BjVcrNw1il1K; Tue, 10 Aug 2010 12:34:47 -0700 (PDT) Received: from perhan.alvh.no-ip.org (190-95-29-207.bk17-dsl.surnet.cl [190.95.29.207]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 48BFF34803D; Tue, 10 Aug 2010 12:34:47 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 2FE726E5FB; Tue, 10 Aug 2010 15:34:45 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: "pgsql-admin@postgresql.org" Subject: Re: postgres function does not handle PUBLIC - expected? From: Alvaro Herrera To: Kasia Tuszynska In-reply-to: <232B5217AD58584C87019E8933556D110211D1AE9F@redmx2.esri.com> References: <232B5217AD58584C87019E8933556D110211D1AE9F@redmx2.esri.com> Date: Tue, 10 Aug 2010 15:34:45 -0400 Message-Id: <1281468594-sup-9380@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201008/71 X-Sequence-Number: 35320 Excerpts from Kasia Tuszynska's message of mar ago 10 15:08:20 -0400 2010: > 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 Yeah, this is a bug, see http://archives.postgresql.org/message-id/4399EF7A-9419-4F84-B51A-A55C5EFAC12A%40nasby.net -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support