pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
permissions from system catalogs
3+ messages / 3 participants
[nested] [flat]

* permissions from system catalogs
@ 2006-06-26 23:30 Kyle Bateman <kyle@actarg.com>
  2006-06-27 01:28 ` Re: permissions from system catalogs Tom Lane <tgl@sss.pgh.pa.us>
  2006-06-27 01:36 ` Re: permissions from system catalogs Michael Fuhr <mike@fuhr.org>
  0 siblings, 2 replies; 3+ messages in thread

From: Kyle Bateman @ 2006-06-26 23:30 UTC (permalink / raw)
  To: pgsql-sql

Can anyone point me where to look in the system catalogs (or information 
schema) to determine in advance whether a given user (or the current 
user) will have select permission to a given table or view?

Kyle




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: permissions from system catalogs
  2006-06-26 23:30 permissions from system catalogs Kyle Bateman <kyle@actarg.com>
@ 2006-06-27 01:28 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2006-06-27 01:28 UTC (permalink / raw)
  To: Kyle Bateman <kyle@actarg.com>; +Cc: pgsql-sql

Kyle Bateman <kyle@actarg.com> writes:
> Can anyone point me where to look in the system catalogs (or information 
> schema) to determine in advance whether a given user (or the current 
> user) will have select permission to a given table or view?

Try has_table_privilege()

http://www.postgresql.org/docs/8.1/static/functions-info.html

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: permissions from system catalogs
  2006-06-26 23:30 permissions from system catalogs Kyle Bateman <kyle@actarg.com>
@ 2006-06-27 01:36 ` Michael Fuhr <mike@fuhr.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Michael Fuhr @ 2006-06-27 01:36 UTC (permalink / raw)
  To: Kyle Bateman <kyle@actarg.com>; +Cc: pgsql-sql

On Mon, Jun 26, 2006 at 05:30:12PM -0600, Kyle Bateman wrote:
> Can anyone point me where to look in the system catalogs (or information 
> schema) to determine in advance whether a given user (or the current 
> user) will have select permission to a given table or view?

An easy way is to use the has_table_privilege() function.  See also
information schema views whose names contain the word "grants" or
"privileges."

http://www.postgresql.org/docs/8.1/interactive/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE
http://www.postgresql.org/docs/8.1/interactive/information-schema.html

(Adjust the version number in the above links if you're using a
version other than 8.1)

-- 
Michael Fuhr



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-06-27 01:36 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-26 23:30 permissions from system catalogs Kyle Bateman <kyle@actarg.com>
2006-06-27 01:28 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-06-27 01:36 ` Michael Fuhr <mike@fuhr.org>

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