<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>role &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/role/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 26 Apr 2018 18:29:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>Greenplum: Script to find Role information with associated Resource Queue</title>
		<link>https://www.dbrnd.com/2017/06/greenplum-script-to-find-role-information-with-associated-resource-queue/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 15 Jun 2017 16:16:33 +0000</pubDate>
				<category><![CDATA[Greenplum]]></category>
		<category><![CDATA[Greenplum DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Greenplum Administrator]]></category>
		<category><![CDATA[Greenplum Error]]></category>
		<category><![CDATA[Greenplum Monitoring]]></category>
		<category><![CDATA[Greenplum Performance Tuning]]></category>
		<category><![CDATA[Greenplum Programming]]></category>
		<category><![CDATA[Greenplum Query]]></category>
		<category><![CDATA[Greenplum Tips and Tricks]]></category>
		<category><![CDATA[PostgreSQL 8.2]]></category>
		<category><![CDATA[Resource Queues]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5409</guid>

					<description><![CDATA[In this post, I am sharing a script to find Greenplum user role information with their associated Resource Queue. You can also find other details like type of user and its validity. We can also use this script to prepare an audit on a list of available users/roles of Greenplum. [crayon-6ab55bb92a422840012421/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-role-information-with-associated-resource-queue%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20Role%20information%20with%20associated%20Resource%20Queue" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-role-information-with-associated-resource-queue%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20Role%20information%20with%20associated%20Resource%20Queue" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-role-information-with-associated-resource-queue%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20Role%20information%20with%20associated%20Resource%20Queue" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-role-information-with-associated-resource-queue%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20Role%20information%20with%20associated%20Resource%20Queue" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-role-information-with-associated-resource-queue%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20Role%20information%20with%20associated%20Resource%20Queue" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-role-information-with-associated-resource-queue%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20Role%20information%20with%20associated%20Resource%20Queue" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-role-information-with-associated-resource-queue%2F&#038;title=Greenplum%3A%20Script%20to%20find%20Role%20information%20with%20associated%20Resource%20Queue" data-a2a-url="https://www.dbrnd.com/2017/06/greenplum-script-to-find-role-information-with-associated-resource-queue/" data-a2a-title="Greenplum: Script to find Role information with associated Resource Queue"></a></p><p>In this post, I am sharing a script to find Greenplum user role information with their associated Resource Queue. You can also find other details like type of user and its validity.<br />
We can also use this script to prepare an audit on a list of available users/roles of Greenplum.</p>
<pre class="crayon-plain-tag">SELECT rolname as RoleName
   ,case
	  when rolsuper = 't' then
		   'SUPERUSER'
	  else
		   'NORMAL'
	  end as SuperUser
   ,case
	  when rolcanlogin = 't' then
		   'LOGIN'
	  else
		   'GROUP'
   end as RoleType
   ,rolvaliduntil as RoleValidUntill
   ,rsqname as RQName
FROM pg_roles, gp_toolkit.gp_resqueue_status
WHERE pg_roles.rolresqueue=gp_toolkit.gp_resqueue_status.queueid
order by rolname;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL Error &#8211; FATAL: database role &#8220;root&#8221; does not exist in Linux</title>
		<link>https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/</link>
					<comments>https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 23 Jan 2017 21:21:42 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[fatal]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[login fail]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[role does not exist]]></category>
		<category><![CDATA[username]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4105</guid>

					<description><![CDATA[A PostgreSQL Fatal error like role or username does not exist. This is a very common error which is facing by PostgreSQL Users. Actually, this is happening because of misconfiguration of System username and Database Username. Most of the Linux users are trying to log in PostgreSQL using root user. But actually, this is wrong. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&#038;title=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" data-a2a-url="https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/" data-a2a-title="PostgreSQL Error – FATAL: database role “root” does not exist in Linux"></a></p><p>A PostgreSQL Fatal error like role or username does not exist. This is a very common error which is facing by PostgreSQL Users.</p>
<blockquote><p>Actually, this is happening because of misconfiguration of System username and Database Username.
</p></blockquote>
<blockquote><p>Most of the Linux users are trying to log in PostgreSQL using root user. But actually, this is wrong. </p></blockquote>
<blockquote><p>You will need to become the operating system user under which PostgreSQL was installed to create the first user account.</p></blockquote>
<blockquote><p>Generally, the default user name is Postgres and default database is also Postgres.<br />
Once you install PostgreSQL on Linux, you should set the password for the Postgres user which is the default super user of PostgreSQL. </p></blockquote>
<blockquote><p>Please do not try to log in with any other default Linux or Unix system user name.
</p></blockquote>
<p><strong>Set password for the default Postgres user:<br />
</strong></p>
<pre class="crayon-plain-tag">sudo passwd postgres</pre> </p>
<p><strong>Create another role using &#8220;postgres&#8221;:<br />
</strong>Creating new role &#8220;dbrnd&#8221;. -p = set the password and -d = allow to create database.</p>
<pre class="crayon-plain-tag">sudo -u postgres createuser dbrnd -d -P</pre> </p>
<blockquote class="wp-embedded-content" data-secret="zQcnw6C0WT"><p><a href="https://www.dbrnd.com/2016/04/postgresql-how-to-install-postgresql-9-4-on-ubuntu-14-04/">PostgreSQL: How to Install PostgreSQL 9.4 on Ubuntu 14.04?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/postgresql-how-to-install-postgresql-9-4-on-ubuntu-14-04/embed/#?secret=zQcnw6C0WT" data-secret="zQcnw6C0WT" width="600" height="338" title="&#8220;PostgreSQL: How to Install PostgreSQL 9.4 on Ubuntu 14.04?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="ViFF2aw9xL"><p><a href="https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/">PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/embed/#?secret=ViFF2aw9xL" data-secret="ViFF2aw9xL" width="600" height="338" title="&#8220;PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL: Find which object assigns to which user or role and vice versa</title>
		<link>https://www.dbrnd.com/2016/10/postgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 05 Oct 2016 16:16:25 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[access privileges]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[GRANT]]></category>
		<category><![CDATA[has_table_privilege()]]></category>
		<category><![CDATA[object permission]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[pg_has_role()]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[REVOKE]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3699</guid>

					<description><![CDATA[As a Database Administrator, we are following common practice by creating Database User or Role and assign only require permission to it. When we are assigning different object level permission to particular Database Role, It is also important check total assigned object to particular Database Role or Which object assigned to which Role/User? Most of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list%2F&amp;linkname=PostgreSQL%3A%20Find%20which%20object%20assigns%20to%20which%20user%20or%20role%20and%20vice%20versa" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list%2F&amp;linkname=PostgreSQL%3A%20Find%20which%20object%20assigns%20to%20which%20user%20or%20role%20and%20vice%20versa" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list%2F&amp;linkname=PostgreSQL%3A%20Find%20which%20object%20assigns%20to%20which%20user%20or%20role%20and%20vice%20versa" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list%2F&amp;linkname=PostgreSQL%3A%20Find%20which%20object%20assigns%20to%20which%20user%20or%20role%20and%20vice%20versa" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list%2F&amp;linkname=PostgreSQL%3A%20Find%20which%20object%20assigns%20to%20which%20user%20or%20role%20and%20vice%20versa" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list%2F&amp;linkname=PostgreSQL%3A%20Find%20which%20object%20assigns%20to%20which%20user%20or%20role%20and%20vice%20versa" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list%2F&#038;title=PostgreSQL%3A%20Find%20which%20object%20assigns%20to%20which%20user%20or%20role%20and%20vice%20versa" data-a2a-url="https://www.dbrnd.com/2016/10/postgresql-find-which-object-assigns-to-which-user-or-role-and-audit-user-role-assigned-object-list/" data-a2a-title="PostgreSQL: Find which object assigns to which user or role and vice versa"></a></p><p>As a Database Administrator, we are following common practice by creating Database User or Role and assign only require permission to it. </p>
<blockquote><p>When we are assigning different object level permission to particular Database Role, It is also important check total assigned object to particular Database Role or Which object assigned to which Role/User?</p></blockquote>
<blockquote><p>Most of the Database Administrators do not have practice to audit the list of assigned permissions of particular Database User/Role. </p></blockquote>
<blockquote><p>It is fine that we are securing database access using specific role, but that is also similarly important to check information about the assigned object and Database Role.<br />
Periodically, Database Administrator should review the list of permissions which assigned to a Database Role/User.</p></blockquote>
<blockquote><p>PostgreSQL provides list of system functions for auditing User, Role, and its permissions.</p></blockquote>
<p>In PostgreSQL, these functions called as Access Privilege Inquiry Functions.<br />
<a href="https://www.postgresql.org/docs/9.1/static/functions-info.html" target="_blank">You can find list of functions in this official document. </a></p>
<p>I have also prepared a small demonstration of this.</p>
<p><strong>First, Create a sample restricted database ROLE:</strong></p>
<pre class="crayon-plain-tag">CREATE ROLE Test_User WITH LOGIN PASSWORD 'Test1234' 
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL 'infinity';</pre> </p>
<p><strong>Assign SELECT, INSERT permission on one sample tbl_employees table:</strong></p>
<pre class="crayon-plain-tag">GRANT SELECT,INSERT ON tbl_employees TO Test_User;</pre> </p>
<p><strong>Using has_table_privilege(), Script to find list of Users or Roles, who have a INSERT permission on tbl_employees. </strong></p>
<pre class="crayon-plain-tag">SELECT rolname 
FROM pg_roles 
WHERE has_table_privilege(rolname, 'tbl_employees', 'INSERT');</pre> </p>
<p><strong>Using pg_has_role(), Script to find list of objects, on which particular User or Role have INSERT permission. </strong></p>
<pre class="crayon-plain-tag">SELECT 
	DISTINCT relname
FROM pg_roles CROSS JOIN pg_class
WHERE pg_has_role('test_user', rolname, 'MEMBER')
	AND has_table_privilege(rolname, pg_class.oid, 'INSERT');</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: Why New User can access all Databases without any Grants</title>
		<link>https://www.dbrnd.com/2016/08/postgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission/</link>
					<comments>https://www.dbrnd.com/2016/08/postgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 16 Aug 2016 17:43:16 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[CONNECT role]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database user]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[GRANT]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[REVOKE]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3515</guid>

					<description><![CDATA[The Database security is always one of the major tasks for all the Database Administrators. I have also prepared one article to create Read only User in PostgreSQL. PostgreSQL: Script to Create a Read-Only Database User In this post, I am sharing small note about REVOKE privileges for newly created Database Users of PostgreSQL. Before [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission%2F&amp;linkname=PostgreSQL%3A%20Why%20New%20User%20can%20access%20all%20Databases%20without%20any%20Grants" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission%2F&amp;linkname=PostgreSQL%3A%20Why%20New%20User%20can%20access%20all%20Databases%20without%20any%20Grants" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission%2F&amp;linkname=PostgreSQL%3A%20Why%20New%20User%20can%20access%20all%20Databases%20without%20any%20Grants" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission%2F&amp;linkname=PostgreSQL%3A%20Why%20New%20User%20can%20access%20all%20Databases%20without%20any%20Grants" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission%2F&amp;linkname=PostgreSQL%3A%20Why%20New%20User%20can%20access%20all%20Databases%20without%20any%20Grants" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission%2F&amp;linkname=PostgreSQL%3A%20Why%20New%20User%20can%20access%20all%20Databases%20without%20any%20Grants" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission%2F&#038;title=PostgreSQL%3A%20Why%20New%20User%20can%20access%20all%20Databases%20without%20any%20Grants" data-a2a-url="https://www.dbrnd.com/2016/08/postgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission/" data-a2a-title="PostgreSQL: Why New User can access all Databases without any Grants"></a></p><p>The Database security is always one of the major tasks for all the Database Administrators.<br />
I have also prepared one article to create Read only User in PostgreSQL. </p>
<blockquote class="wp-embedded-content" data-secret="KAMMknEJXF"><p><a href="https://www.dbrnd.com/2015/10/postgresql-script-to-create-a-read-only-database-user/">PostgreSQL: Script to Create a Read-Only Database User</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/10/postgresql-script-to-create-a-read-only-database-user/embed/#?secret=KAMMknEJXF" data-secret="KAMMknEJXF" width="600" height="338" title="&#8220;PostgreSQL: Script to Create a Read-Only Database User&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>In this post, I am sharing small note about REVOKE privileges for newly created Database Users of PostgreSQL. </p></blockquote>
<blockquote><p>Before a few days ago, one of the PostgreSQL Junior DBA asked this question on my FB Page. He created one new DB User in PostgreSQL and without giving a any permission that USER can CONNECT to all Databases. </p></blockquote>
<blockquote><p>Yes: When you create any new DB User in PostgreSQL, It has a default CONNECT privileges.<br />
But It cannot access any Table or data of Databases, yes It can create new Table in any Database. </p></blockquote>
<p>To prevent a new User for connecting any existing Database, we should run REVOKE command on particular User or Role.</p>
<p><strong>REVOKE CONNECT privileges from Database:</strong></p>
<pre class="crayon-plain-tag">REVOKE CONNECT ON DATABASE Database_Name FROM User_Name;</pre> </p>
<p><strong>REVOKE all privileges from Database: </strong></p>
<pre class="crayon-plain-tag">REVOKE ALL PRIVILEGES ON DATABASE Database_Name FROM User_Name;</pre> </p>
<p><strong>You should GRANT only required Databases:</strong></p>
<pre class="crayon-plain-tag">GRANT CONNECT ON DATABASE Database_Name TO User_Name;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/08/postgresql-why-new-user-can-access-all-databases-without-any-grants-revoke-connect-permission/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>NoSQL: Cassandra introduces Role Based Authentication</title>
		<link>https://www.dbrnd.com/2016/05/nosql-cassandra-introduces-role-based-authentication/</link>
					<comments>https://www.dbrnd.com/2016/05/nosql-cassandra-introduces-role-based-authentication/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 08 May 2016 20:33:32 +0000</pubDate>
				<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Column Store]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Document Store]]></category>
		<category><![CDATA[GRANT]]></category>
		<category><![CDATA[Graph Store]]></category>
		<category><![CDATA[Key Value Store]]></category>
		<category><![CDATA[Not Only SQL]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[Unstrucutred]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2736</guid>

					<description><![CDATA[Prior to Cassandra 2.2, it supports only User base authentication, but now Cassandra introduces new Role-based authentication. In this post, I am sharing a demonstration on how to create a Role in Cassandra and How to assign different permissions to that role. You can directly use this Role for authentication and you can also assign [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-cassandra-introduces-role-based-authentication%2F&amp;linkname=NoSQL%3A%20Cassandra%20introduces%20Role%20Based%20Authentication" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-cassandra-introduces-role-based-authentication%2F&amp;linkname=NoSQL%3A%20Cassandra%20introduces%20Role%20Based%20Authentication" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-cassandra-introduces-role-based-authentication%2F&amp;linkname=NoSQL%3A%20Cassandra%20introduces%20Role%20Based%20Authentication" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-cassandra-introduces-role-based-authentication%2F&amp;linkname=NoSQL%3A%20Cassandra%20introduces%20Role%20Based%20Authentication" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-cassandra-introduces-role-based-authentication%2F&amp;linkname=NoSQL%3A%20Cassandra%20introduces%20Role%20Based%20Authentication" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-cassandra-introduces-role-based-authentication%2F&amp;linkname=NoSQL%3A%20Cassandra%20introduces%20Role%20Based%20Authentication" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-cassandra-introduces-role-based-authentication%2F&#038;title=NoSQL%3A%20Cassandra%20introduces%20Role%20Based%20Authentication" data-a2a-url="https://www.dbrnd.com/2016/05/nosql-cassandra-introduces-role-based-authentication/" data-a2a-title="NoSQL: Cassandra introduces Role Based Authentication"></a></p><p>Prior to Cassandra 2.2, it supports only User base authentication, but now Cassandra introduces new Role-based authentication.</p>
<p>In this post, I am sharing a demonstration on how to create a Role in Cassandra and How to assign different permissions to that role.<br />
You can directly use this Role for authentication and you can also assign same Role permission to another role.</p>
<p><strong>First, login with Cassandra&#8217;s super user. </strong></p><pre class="crayon-plain-tag">cqlsh -u cassanddra -p cassandra</pre><p>
<p><strong>Create keyspace if not exists:</strong></p><pre class="crayon-plain-tag">CREATE KEYSPACE IF NOT EXISTS dbrnd WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 3};

USE dbrnd;</pre><p>
<p><strong>Create few sample tables:</strong></p><pre class="crayon-plain-tag">CREATE TABLE IF NOT EXISTS tbl_Employee 
(
	EmpID INT PRIMARY KEY
	,EmpFirstName VARCHAR
	,EmpLastName VARCHAR
	,EmpSalary INT
);

CREATE TABLE IF NOT EXISTS tbl_Department
(
	DeptID INT PRIMARY KEY
	,DeptName VARCHAR
);</pre><p>
<p><strong>Create one sample Role without Superuser access:</strong><br />
<a href="https://www.dbrnd.com/2016/05/nosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password/" target="_blank"><strong>If you get this error :  &#8220;org.apache.cassandra.auth.CassandraRoleManager doesn&#8217;t support PASSWORD&#8221;, visit this solution. </strong></a></p><pre class="crayon-plain-tag">CREATE ROLE ReportingRole WITH PASSWORD = 'pass123' AND LOGIN = true AND SUPERUSER = false;</pre><p>
<p><strong>Grant different permissions to this Role:</strong></p><pre class="crayon-plain-tag">GRANT SELECT ON dbrnd.tbl_Employee TO ReportingRole;
GRANT MODIFY ON dbrnd.tbl_Department TO ReportingRole;</pre><p>
<p><strong>If you get any error like &#8221; GRANT operation is not supported by AllowAllAuthorizer&#8221;, you have to modify the value of &#8220;authorizer&#8221; in cassandra.yaml file. </strong></p><pre class="crayon-plain-tag">-- Old value:
 authorizer: AllowAllAuthorizer
 
 -- Change to this New value:
 authorizer: org.apache.cassandra.auth.CassandraAuthorizer</pre><p>
<p><strong>Grant over the all keyspaces:</strong></p><pre class="crayon-plain-tag">GRANT SELECT ON ALL KEYSPACES TO ReportingRole;
GRANT MODIFY ON ALL KEYSPACES TO ReportingRole;</pre><p>
<p><strong>Create new test Role and make it a replica of the current role:</strong></p><pre class="crayon-plain-tag">CREATE ROLE Test WITH PASSWORD = 'pass123' AND LOGIN = true AND SUPERUSER = false;

GRANT ReportingRole to Test;</pre><p>
<p><strong>List out all Roles and its permissions:</strong></p><pre class="crayon-plain-tag">-- List out all Roles.
LIST ROLES;
-- List out all permissions of the Role.
LIST ALL PERMISSIONS OF ReportingRole;</pre><p>
<a href="https://www.dbrnd.com/wp-content/uploads/2016/05/CassandraUserRole.png" rel="attachment wp-att-2741"><img loading="lazy" decoding="async" class="alignnone wp-image-2741 size-full" title="Cassandra User Role" src="https://www.dbrnd.com/wp-content/uploads/2016/05/CassandraUserRole.png" alt="Cassandra User Role" width="650" height="189" srcset="https://www.dbrnd.com/wp-content/uploads/2016/05/CassandraUserRole.png 650w, https://www.dbrnd.com/wp-content/uploads/2016/05/CassandraUserRole-300x87.png 300w, https://www.dbrnd.com/wp-content/uploads/2016/05/CassandraUserRole-150x44.png 150w" sizes="auto, (max-width: 650px) 100vw, 650px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/05/nosql-cassandra-introduces-role-based-authentication/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL: Script to Create a Read-Only Database User</title>
		<link>https://www.dbrnd.com/2015/10/postgresql-script-to-create-a-read-only-database-user/</link>
					<comments>https://www.dbrnd.com/2015/10/postgresql-script-to-create-a-read-only-database-user/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 22 Oct 2015 16:20:45 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[PostgreSQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[PostgreSQL Tuning]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=911</guid>

					<description><![CDATA[In this post, I am sharing the help on how to create, a read-only user with limited access in PostgreSQL Database Server?. As a Database Administrator, you should create different database users for the different purposes. In the standard application, there are a few various types of Database Users like Application user, Read-only user, Admin [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-create-a-read-only-database-user%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Create%20a%20Read-Only%20Database%20User" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-create-a-read-only-database-user%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Create%20a%20Read-Only%20Database%20User" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-create-a-read-only-database-user%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Create%20a%20Read-Only%20Database%20User" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-create-a-read-only-database-user%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Create%20a%20Read-Only%20Database%20User" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-create-a-read-only-database-user%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Create%20a%20Read-Only%20Database%20User" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-create-a-read-only-database-user%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Create%20a%20Read-Only%20Database%20User" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-create-a-read-only-database-user%2F&#038;title=PostgreSQL%3A%20Script%20to%20Create%20a%20Read-Only%20Database%20User" data-a2a-url="https://www.dbrnd.com/2015/10/postgresql-script-to-create-a-read-only-database-user/" data-a2a-title="PostgreSQL: Script to Create a Read-Only Database User"></a></p><p>In this post, I am sharing the help on how to create, a read-only user with limited access in PostgreSQL Database Server?.</p>
<p>As a Database Administrator, you should create different database users for the different purposes.<br />
In the standard application, there are a few various types of Database Users like Application user, Read-only user, Admin user.</p>
<p><strong>You should always create a shared database role group and assign roles to the user. </strong></p>
<p>Here, I am sharing one script to create the read only user with limited access to PostgreSQL Database. This user can only SELECT table data and also restricted by schema access. </p>
<p><strong>Create the Read-Only user:</strong></p>
<pre class="crayon-plain-tag">CREATE ROLE Read_Only_User WITH LOGIN PASSWORD 'Test1234' 
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL 'infinity';</pre> </p>
<p><strong>Assign permissions to the read only user:</strong></p>
<pre class="crayon-plain-tag">GRANT CONNECT ON DATABASE YourDatabaseName TO Read_Only_User;
GRANT USAGE ON SCHEMA public TO Read_Only_User;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO Read_Only_User;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO Read_Only_User;</pre> </p>
<p>In the above script, you can find that I restricted user by Database, Schema and gave only SELECT permission for tables. </p>
<p><strong>If you need to give any additional permission like EXECUTE permission for functions, use below script. </strong></p>
<pre class="crayon-plain-tag">GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO Read_Only_User;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/10/postgresql-script-to-create-a-read-only-database-user/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
	</channel>
</rss>
