<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Greenplum: Script to find the size and usage statistics of Indexes	</title>
	<atom:link href="https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 24 May 2018 05:51:10 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: Suma		</title>
		<link>https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/#comment-6461</link>

		<dc:creator><![CDATA[Suma]]></dc:creator>
		<pubDate>Thu, 24 May 2018 05:51:10 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5373#comment-6461</guid>

					<description><![CDATA[Correct script:-

select rpt.grantee,rpt.rolcanlogin2,rpt.connect_r,rpt.connect_sso_r,
case
when rpt.connect_r=TRUE and rpt.connect_sso_r=TRUE then ‘ERROR’
when rpt.connect_r=FALSE and rpt.connect_sso_r=FALSE then ‘ERROR’
else ‘OK’ end as “flag”
from (
select r.grantee,r.rolcanlogin2,r.grantor,
case when r.grantor=’udw_prd_connect_r’ then TRUE else FALSE
end as “connect_r”,
case when r.grantor=’udw_prd_connect_sso_r’ then TRUE else FALSE
end as “connect_sso_r”
from(
select au2.rolname grantee,au2.rolcanlogin AS rolcanlogin2,au1.rolname grantor,
au1.rolcanlogin rolcalogin1 from pg_catalog.pg_auth_members m,
pg_catalog.pg_authid au2 , pg_catalog.pg_authid au1
where m.roleid=au1.oid and m.member=au2.oid
and aq1.rolname in (&#039;udw_prd_connect_r&#039;,&#039;udw_prd_connect_sso_r&#039;) r
group by 1,2,3
) rpt
order by 1,2;

Please help to find out the result.]]></description>
			<content:encoded><![CDATA[<p>Correct script:-</p>
<p>select rpt.grantee,rpt.rolcanlogin2,rpt.connect_r,rpt.connect_sso_r,<br />
case<br />
when rpt.connect_r=TRUE and rpt.connect_sso_r=TRUE then ‘ERROR’<br />
when rpt.connect_r=FALSE and rpt.connect_sso_r=FALSE then ‘ERROR’<br />
else ‘OK’ end as “flag”<br />
from (<br />
select r.grantee,r.rolcanlogin2,r.grantor,<br />
case when r.grantor=’udw_prd_connect_r’ then TRUE else FALSE<br />
end as “connect_r”,<br />
case when r.grantor=’udw_prd_connect_sso_r’ then TRUE else FALSE<br />
end as “connect_sso_r”<br />
from(<br />
select au2.rolname grantee,au2.rolcanlogin AS rolcanlogin2,au1.rolname grantor,<br />
au1.rolcanlogin rolcalogin1 from pg_catalog.pg_auth_members m,<br />
pg_catalog.pg_authid au2 , pg_catalog.pg_authid au1<br />
where m.roleid=au1.oid and m.member=au2.oid<br />
and aq1.rolname in (&#8216;udw_prd_connect_r&#8217;,&#8217;udw_prd_connect_sso_r&#8217;) r<br />
group by 1,2,3<br />
) rpt<br />
order by 1,2;</p>
<p>Please help to find out the result.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Suma		</title>
		<link>https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/#comment-6460</link>

		<dc:creator><![CDATA[Suma]]></dc:creator>
		<pubDate>Thu, 24 May 2018 05:47:02 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5373#comment-6460</guid>

					<description><![CDATA[Hi Anvesh,

I need help on this.
There are so many regular users have udw_prd_connect__r group rle.ally 
Usually regular users should have acccess for udw_prd_connect__sso_r group role to connect to the PRD database.
Task:- Need to find the only regular users who have access for udw_prd_connect_r incorrectly.
Need to write a script for this..Below where i am going wrong find out.let me know..Or please if possible modify.

select rpt.grantee,rpt.rolcanlogin2,rpt.connect_r,rpt.connect_sso_r,
case 
when rpt.connect_r=TRUE and rpt.connect_sso_r=TRUE then &#039;ERROR&#039;
when rpt.connect_r=FALSE and rpt.connect_sso_r=FALSE then &#039;ERROR&#039;
else &#039;OK&#039; end as &quot;flag&quot;
from (
select r.grantee,r.rolcanlogin2,r.grantor,
case when r.grantor=&#039;udw_prd_connect_r&#039; then TRUE else FALSE
end as &quot;connect_r&quot;,
case when r.grantor=&#039;udw_prd_connect_sso_r&#039; then TRUE else FALSE 
end as &quot;connect_sso_r&quot;
from(
select au2.rolname grantee,au2.rolcanlogin AS rolcanlogin2,au1.rolname grantor,
au1.rolcanlogin  rolcalogin1 from pg_catalog.pg_auth_members m,
pg_catalog.pg_authid au2 , pg_catalog.pg_authid au1 
where m.roleid=au1.oid and m.member=au2.oid

This query will not encounter the errors. but it will show the duplicate rows because some users have both roles (udw_prd_connect_r and udw_prd_connect_sso_r) but i need every user should have one row.

TASK:
Need to exapand:-
Regular user should have udw_prd_connect_r
Service account should not have udw_prd_connect_sso_r

Please help me out to get proper result.


Thank you,
Suma R]]></description>
			<content:encoded><![CDATA[<p>Hi Anvesh,</p>
<p>I need help on this.<br />
There are so many regular users have udw_prd_connect__r group rle.ally<br />
Usually regular users should have acccess for udw_prd_connect__sso_r group role to connect to the PRD database.<br />
Task:- Need to find the only regular users who have access for udw_prd_connect_r incorrectly.<br />
Need to write a script for this..Below where i am going wrong find out.let me know..Or please if possible modify.</p>
<p>select rpt.grantee,rpt.rolcanlogin2,rpt.connect_r,rpt.connect_sso_r,<br />
case<br />
when rpt.connect_r=TRUE and rpt.connect_sso_r=TRUE then &#8216;ERROR&#8217;<br />
when rpt.connect_r=FALSE and rpt.connect_sso_r=FALSE then &#8216;ERROR&#8217;<br />
else &#8216;OK&#8217; end as &#8220;flag&#8221;<br />
from (<br />
select r.grantee,r.rolcanlogin2,r.grantor,<br />
case when r.grantor=&#8217;udw_prd_connect_r&#8217; then TRUE else FALSE<br />
end as &#8220;connect_r&#8221;,<br />
case when r.grantor=&#8217;udw_prd_connect_sso_r&#8217; then TRUE else FALSE<br />
end as &#8220;connect_sso_r&#8221;<br />
from(<br />
select au2.rolname grantee,au2.rolcanlogin AS rolcanlogin2,au1.rolname grantor,<br />
au1.rolcanlogin  rolcalogin1 from pg_catalog.pg_auth_members m,<br />
pg_catalog.pg_authid au2 , pg_catalog.pg_authid au1<br />
where m.roleid=au1.oid and m.member=au2.oid</p>
<p>This query will not encounter the errors. but it will show the duplicate rows because some users have both roles (udw_prd_connect_r and udw_prd_connect_sso_r) but i need every user should have one row.</p>
<p>TASK:<br />
Need to exapand:-<br />
Regular user should have udw_prd_connect_r<br />
Service account should not have udw_prd_connect_sso_r</p>
<p>Please help me out to get proper result.</p>
<p>Thank you,<br />
Suma R</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
