Unable to query information_schema.constraint_column_usage - Mailing list pgsql-admin

From Erwin Fritz
Subject Unable to query information_schema.constraint_column_usage
Date
Msg-id 9E6E27BCA0E8EE478089F158D73AF936A93C8718@Exch10-Mailbox.corp.gljpc.com
Whole thread Raw
List pgsql-admin

Hello, all.

 

I’m trying to build a query that joins several information_schema views. The role I’m using has SELECT and USAGE permissions into the account whose tables I care about.

 

I connect as the role and run this:

 

select count(*) from information_schema.table_constraints;

count

-------

  1125

(1 row)

 

All good.

 

Now I run this:

 

select count(*) from information_schema.constraint_column_usage;

count

-------

     0

(1 row)

 

This view is missing data on several foreign key constraints that exist in the schema I care about. When I run these queries as ‘postgres’, they work fine (naturally).

 

What permissions do I need to grant the querying role so it can see the constraint columns belonging to another schema? Why does querying on the table_constraints view work, but on constraint_column_usage not work?

 

 

 

 

 

Erwin Fritz
IS Operations Manager
GLJ Petroleum Consultants
Tel:  +1 (403) 266-9570


This message is intended only for the recipient(s) to which it is addressed and may contain information that is privileged and confidential. If you have received this message in error, please notify the sender immediately and delete all copies.


Attachment

pgsql-admin by date:

Previous
From: Rajni Baliyan
Date:
Subject: Re: recovery.conf not getting changed to recovery.done after PITR
Next
From: Joao Ribeiro
Date:
Subject: Schema's vs Single Database with prefix on tables