0

So basically I have 2 superusers, postgres and eric, each with their own databases. What I want to do is, while being connected to one of them, access the database (tables to be more precise) of the other. The tables of both databases are in public schema.

I am using this query, which I found on another question on the forum, but without any result:

SELECT table_name
FROM information_schema.tables
WHERE table_schema='public'

I have changed the owners of the databases, offered all the privileges to both roles, but nothing. All I get are only the tables of the database under that user, not both.

Any idea what I could be missing? Thanks.

P.S: I am using PostgreSQL 9.3, and coding in Python 2.7

2 Answers2

1

Superusers can always access everything in the whole cluster.

This sentence makes no sense:

Both databases are in public schema.

Cluster -> database -> schema -> table. Start with the manual here.

While connected to a particular database you can only access tables of this particular database. You have to connect to a different database to work with tables there.
Or you can use dblink or FDW.

Community
  • 1
  • 1
Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228
-1

PostgreSQL has a firewall between different databases. They might as well be on totally separate servers. You can use dblink or fdw or something like those to bridge between them.

jjanes
  • 37,812
  • 5
  • 27
  • 34