Querying the same column and table across schemas - Mailing list pgsql-admin

From John A. Sullivan III
Subject Querying the same column and table across schemas
Date
Msg-id 1267818283.15754.42.camel@Family.pacifera.com
Whole thread Raw
Responses Re: Querying the same column and table across schemas  ("Daniel J. Summers" <daniel.lists@djs-consulting.com>)
Re: Querying the same column and table across schemas  (Bob Lunney <bob_lunney@yahoo.com>)
List pgsql-admin
Hello, all.  I'm working on a project using the X2Go terminal server
project (www.x2go.org).  They record session data in a postgresql
database.  Our environment is a little more secure than typical and we
do not want it possible for one user to see another's session data.  We
thus have divided the session database into schemas each with an
identical set of tables.  Each user only writes and reads from their
schema.

However, we need to query all schemas as if they were one.  Is there a
way to do that?

In other words, if we were a single schema database, we could do

select session_id from sessions;

to list all sessions.  How can we accomplish the same thing to list all
the sessions across all the schemas in a single query?

I'm trying to avoid making a thousand call like

select user1.session_id from user1.sessions;

when I could do it in a single query especially since the database is
remote and secured with SSL.

Thanks - John


pgsql-admin by date:

Previous
From: "Plugge, Joe R."
Date:
Subject: Re: [SQL] PostgreSQL Active-Active Configuration
Next
From: "Daniel J. Summers"
Date:
Subject: Re: Querying the same column and table across schemas