Re: how to grant select on table using trigger - Mailing list pgsql-admin

From Michael Fuhr
Subject Re: how to grant select on table using trigger
Date
Msg-id 20050108160616.GA5705@winnie.fuhr.org
Whole thread Raw
In response to Re: how to grant select on table using trigger  (Michael Fuhr <mike@fuhr.org>)
List pgsql-admin
[Please copy the mailing list when you reply.]

On Sat, Jan 08, 2005 at 01:09:29AM -0800, santosh dwivedi wrote:

> I re-written the trigger and function like , run time it gives the following warning
>  WARNING:  Error occurred while executing PL/pgSQL function permitselect
> WARNING:  line 2 at execute statement

Is that the complete message?  Does anything else show up on your
screen or in the server logs?  What statement did you execute that
caused these warnings?  What version of PostgreSQL are you using?

> EXECUTE ''GRANT SELECT ON '' || quote_ident(NEW.query_table) || '' TO
> GROUP wp'';

What data type is query_table?  I ran a test with query_table as a
TEXT column and the code you posted worked in 7.4.6 and 8.0.0rc4.
If query_table is some other type (e.g., OID), then you'll need to
convert it to a string that contains the table name.

Please post a self-contained example: all CREATE and other statements
that somebody could copy and paste into an empty database to reproduce
the problem.  Please reduce the problem as much as possible: if a
table has 50 columns then we probably don't need to see them all --
if only one column is relevant then create a test table with just
that one column.  That makes it easier for everybody (including you)
to see what's going on.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-admin by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: error in start a Data base
Next
From: Jimmy P Mani
Date:
Subject: backup