<FONT size=2>
<P>Hai,</P>
<P> I create a plpgsql function for grant rights for the postgres users. The same function is working properly in the previous versions. But it gives the following error message.</P>
<P>// Error Message given by the postgres</P>
<P>ERROR: relation "sql_features" does not exist<BR>CONTEXT: PL/pgSQL function "unlockuser" line 6 at execute statement</P>
<P>//***********</P>
<P>//******** Function i created ****************</P>
<P>create or replace function unlockuser(name) returns integer as'</P>
<P>declare</P>
<P>usrname alias for $1;</P>
<P>tablelist record;</P>
<P>begin</P>
<P>for tablelist in select * from pg_tables where tablename not like ''pg_%'' and tablename not like ''pb%'' order by tablename loop</P>
<P>execute ''grant all on ''|| quote_ident(tablelist.tablename)</P>
<P>||'' to ''|| usrname;</P>
<P>end loop;</P>
<P>if not found then</P>
<P>return 0;</P>
<P>end if;</P>
<P>for tablelist in select * from pg_views where viewname not like ''pg_%'' order by viewname loop</P>
<P>execute ''grant all on ''|| quote_ident(tablelist.viewname)||'' to ''|| usrname;</P>
<P>end loop;</P>
<P>if not found then</P>
<P>return 0;</P>
<P>end if;</P>
<P>for tablelist in select * from pg_statio_user_sequences order by relname loop</P>
<P>execute ''grant all on ''|| quote_ident(tablelist.relname)||'' to ''|| usrname;</P>
<P>end loop;</P>
<P>if not found then</P>
<P>return 0;</P>
<P>end if;</P>
<P>return 1;</P>
<P>end;</P>
<P>'language 'plpgsql';</P>
<P>// ****************** *****************</P>
<P>Thanks in advance</P></FONT><BR>