Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkAC8-0005nZ-RB for pgsql-general@arkaria.postgresql.org; Sat, 13 Jun 2020 17:43:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jkAC7-0005ML-6n for pgsql-general@arkaria.postgresql.org; Sat, 13 Jun 2020 17:43:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkAC5-0005ME-Gp for pgsql-general@lists.postgresql.org; Sat, 13 Jun 2020 17:43:50 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkAC1-0008DH-Ao for pgsql-general@postgresql.org; Sat, 13 Jun 2020 17:43:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id AA85C41F; Sat, 13 Jun 2020 13:43:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 13 Jun 2020 13:43:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=L gZ7kXOf4jfFwswhgT3mXoVROwi+XFTM6PSkLZ9eNqk=; b=AlDi0yJFfA3baZkNJ CY5QDOlPDts9dtKjEps0W8FfolKlij2UqhCkWOie0gMv/LIgZRZt6lNZIiKujllh WDmzh6B9jdL6jwhQo6A8SUKVEh1hH/jbC19uS087yNRkPAac9Um3quzXI2+rOXqc 14pcKfjvPam3DPLsyZueaNT5PF9vrdPa+yomlp/ZaEHPNA7S+NzCKizbiWVBSoRz IcbRi6oTnbxvOPqdeF4QsDQgT+DHFzd1Mw0YurkWgy69CiD10m/05bgoQ4urr44a en4ag2YN+fNyhcNb9eQBWqyPYWq5vA7svIlBdmDOoAUdc/ljterHCof5fVBftTSF mKa0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=LgZ7kXOf4jfFwswhgT3mXoVROwi+XFTM6PSkLZ9eN qk=; b=FKSM+eM5S7VtgSSSw+ta/OfCrECzbYrHdAe1TPFb+hjHgs++17MXY6B3v vJgdWYXXzYxB8dy3jplZOnV707u6LgxRcpPSi1OuvHu7GlFyZJygsnOE4c2dyhlJ R7iw9QAml3sfiVnuZcihWaWy3aqlXLx8cJ1rKXKKhJ5iPOUkTvXIqO2qGjoFe0wc F62MiXB2IfU67nb6p5kqaMFKoogjTa52qnMytpmo7iZLovgZEDvHWHf/221WQZH5 3p3/cPSLyiuPIhlx+apwQsMccVTBYL5t0ck2Mv+4XyWeCdJT5SO2bw/mOkPNe7IN PKSnSQo6rSGr6KCKt2SQY3E8biw/A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeifedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeevveefve efueegffekkefhgeeiueffgfetueejvdfghfeujeejhfekjeelgedtgeenucfkphepjeeh rddujedvrdehrddvfedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id AB0773061856; Sat, 13 Jun 2020 13:43:39 -0400 (EDT) Subject: Re: Fwd: not able to give usage access to public schema To: sekhar chandra Cc: pgsql-general@postgresql.org References: From: Adrian Klaver Message-ID: <5302c3f0-5bef-6d1f-6bf3-7926fa70358f@aklaver.com> Date: Sat, 13 Jun 2020 10:43:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/13/20 10:33 AM, sekhar chandra wrote: > Adrian - when I follow the same steps what you did . in my case , the > result is false. > > > grant usage on schema public to role_test ; > GRANT > > SELECT rolname, has_schema_privilege('role_test', 'public', 'usage') > from pg_roles where rolname = 'role_test'; >    rolname  | has_schema_privilege > -----------+---------------------- >   role_test | f Postgres version and where are you running this e.g. cloud service? What does \dn+ public show before and after you redo commands as asked below? Can you start over and provide complete sequence for above including CREATE ROLE and what user you are doing the above as? > > On Fri, Jun 12, 2020 at 10:11 PM Adrian Klaver > > wrote: > > On 6/12/20 3:56 PM, sekhar chandra wrote: > > I am not able to give usage permission to public schema. below > are the > > steps. > > > > > > Logged in as super user > > created a new user as user1 > > grant usage on public to user1 > > Either the above is a cut and paste error or you got an error: > > grant usage on public to role_test ; > ERROR:  relation "public" does not exist > > grant usage on schema public to role_test ; > GRANT > > SELECT rolname, has_schema_privilege('role_test', 'public', 'usage') > from pg_roles where rolname = 'role_test'; >    rolname  | has_schema_privilege > -----------+---------------------- >   role_test | t > > > > > > command completed successfully , but verification statement > showing he > > doesnt have usage permission. > > SELECT rolname, has_schema_privilege(rolname, 'public', 'usage') > from > > pg_roles; > > > > this is strage. what could go wrong. > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com