Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id D8CA92E004A for ; Mon, 28 Apr 2008 18:48:06 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 65337-03 for ; Mon, 28 Apr 2008 18:48:02 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by developer.postgresql.org (Postfix) with ESMTP id 2D2A32E002D for ; Mon, 28 Apr 2008 18:48:01 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 5so1512980ywb.73 for ; Mon, 28 Apr 2008 14:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=0UUAxyVoaYIK4yxadVw4RTx4fXebhW8Of0tAVvpmDLk=; b=cd8OiVVBWrwKxISYwaaJQ8hvMT8t6fjYvHk4MaNII5eyv8nCFBGnu0MlM/2oT1bJaKfEfgqMFSJ9iO9wxJYPdlBy1tilI9UhI02Ol1Ja7rFDaWozGSDwpeqwwflTZ65ZjXZEAfzYzoGbChc9XyqiTuUoC8RpO+J60Atyj2Ybpzk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=iRFhClOuSxDqTE07DMtLfHRULWYk/XDGieAuIJon7La/YPqD01KrnHhtgGQnpKHz5/C0pBhRbjVPg3tWdaPqgPyh2hWAyvOMC20k38K7g54IzMeT3xFbZNAnwgzVhi9JB0Sknj6B2IgvGJhpfh1opOm1AHULFL6V1Sg2GIZB/Pg= Received: by 10.150.49.1 with SMTP id w1mr4404625ybw.23.1209419279984; Mon, 28 Apr 2008 14:47:59 -0700 (PDT) Received: by 10.151.142.5 with HTTP; Mon, 28 Apr 2008 14:47:59 -0700 (PDT) Message-ID: <2d734e2f0804281447l5de57868na1a5415b0a95ee28@mail.gmail.com> Date: Mon, 28 Apr 2008 17:47:59 -0400 From: "Lodewijk Voege" To: pgsql-sql@postgresql.org Subject: information_schema.referential_constraints permissions MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/214 X-Sequence-Number: 30753 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