Skip to content

pgr_getTableName fails when current user is not owner of a table's schema #241

Open
@talin-trulia

Description

@talin-trulia

When the current role accessing the database is not the owner of the schema where a table lives, pgr_getTableName returns null, null, even though the table exists, and is readable to the role.

I believe this is because pgr_getTableName reads from information_schema.schemata, which only lists schemas actually owned by the current role, not all schemas accessible.

example: user1 is the owner of a database, and thus is owner of the public schema. user2 has read access to the public schema.

as user1:

db_name=# select * from pgr_getTableName('edge_table');
sname  |   tname    
--------+------------
public | edge_table
(1 row)

as user2:

db_name=> select * from pgr_getTableName('edge_table');
sname | tname 
-------+-------
         | 
(1 row)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions