From: Michael Fuhr <mike@fuhr.org>
To: santosh dwivedi <mwanaag@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: how to grant select on table using trigger
Date: Sat, 8 Jan 2005 09:06:16 -0700
Message-ID: <20050108160616.GA5705@winnie.fuhr.org> (raw)
In-Reply-To: <20050108090930.96471.qmail@web52101.mail.yahoo.com>
References: <20050107095001.GA81396@winnie.fuhr.org>
<20050108090930.96471.qmail@web52101.mail.yahoo.com>
[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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, mwanaag@yahoo.com
Subject: Re: how to grant select on table using trigger
In-Reply-To: <20050108160616.GA5705@winnie.fuhr.org>
References: <20050107095001.GA81396@winnie.fuhr.org> <20050108090930.96471.qmail@web52101.mail.yahoo.com> <20050108160616.GA5705@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox