Lists: | pgsql-patches |
---|
From: | <rajaguru(at)rajahsoft(dot)net> |
---|---|
To: | Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com> |
Cc: | pgsql-patches(at)postgresql(dot)org |
Subject: | "sql_features" does not exist( Very Urgent) |
Date: | 2004-02-26 17:18:29 |
Message-ID: | E1AwP9Z-0000CI-Us@server.yourhostingaccount.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg사설 토토 사이트SQL |
<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>
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/html | 1.6 KB |
From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
---|---|
To: | rajaguru(at)rajahsoft(dot)net |
Cc: | Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: "sql_features" does not exist( Very Urgent) |
Date: | 2004-02-26 17:27:04 |
Message-ID: | 20040226092449.X57017@megazone.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
On Thu, 26 Feb 2004 rajaguru(at)rajahsoft(dot)net wrote:
> 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.
You're not putting in the schema names in your grant statements so things
in schemas that are not part of your search path fail (and it would do the
wrong thing for tables hidden by other tables earlier in your search
path I believe).