pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lodewijk Voege <lvoege@gmail.com>
To: pgsql-sql@postgresql.org
Subject: information_schema.referential_constraints permissions
Date: Mon, 28 Apr 2008 17:47:59 -0400
Message-ID: <2d734e2f0804281447l5de57868na1a5415b0a95ee28@mail.gmail.com> (raw)

hello,

I have some code that gets foreign key information from
information_schema.referential_constraints. I was puzzled about why it wasn't
returning anything for a while, until I read the information_schema.sql file
and the documentation carefully: it has a pg_has_role(c.relowner, 'USAGE') in
it and the documentation states "The view referential_constraints contains all
referential integrity (foreign key) constraints in the current database that
belong to a table owned by a currently enabled role".

Fair enough. But then I read the public draft of SQL 2003 and 200n on this
view, and it speaks only of "tables in this catalog that are accessible to a
given user or role", rather than ownership. the user I was working with most
definately had access. it could also read the pg_* system catalog, such that
if I copy/paste the view definition without the pg_has_role() line in it (and
massage it a bit to remove the CASTs to sql_identifier and character_data)
that user got just what I was expecting.

so, is that restriction correct?

Lodewijk



view thread (2+ messages)  latest in thread

Message-ID: <2d734e2f0804281447l5de57868na1a5415b0a95ee28@mail.gmail.com>
Permalink:  ../2d734e2f0804281447l5de57868na1a5415b0a95ee28@mail.gmail.com/
Also on:    postgresql.org/message-id/2d734e2f0804281447l5de57868na1a5415b0a95ee28@mail.gmail.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lvoege@gmail.com
  Subject: Re: information_schema.referential_constraints permissions
  In-Reply-To: <2d734e2f0804281447l5de57868na1a5415b0a95ee28@mail.gmail.com>

* 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