Re: Aggregating data from stored procedures across multiple schemas

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Rich Compton <rich(dot)compton(at)curvedental(dot)com>
Cc: pgsql-in-general(at)postgresql(dot)org
Subject: Re: Aggregating data from stored procedures across multiple schemas
Date: 2016-06-02 08:53:51
Message-ID: CAFjFpRf+3h7+58v6rR8KRJFrJrtWSB5Lb1F8itFSb-qGQYvRuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-in-general

On Thu, Jun 2, 2016 at 4:10 AM, Rich Compton <rich(dot)compton(at)curvedental(dot)com>
wrote:

> This is my first post so bear with me. I will most likely miss
> information.
>
> Our current architecture is that each of our clients has their own
> schemas. We have some clients considered enterprise clients that actually
> own several offices (schemas). We are looking into aggregating data for
> them for an enterprise portal of sorts. Each of our schemas have
> procedures that tally all the production data we need. I am looking for a
> way to aggregate all the data across multiple schemas using the stored
> procedures.
>
> My first vain attempt was with union all which works with views and tables
> but not functions since they are not defined outside the schemas themselves.
>

I don't understand this. Set returning functions can be queried just like
views or tables. They can be schema qualified as well. An example might
help.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-in-general by date

  From Date Subject
Next Message Rich Compton 2016-06-02 18:43:27 Re: Aggregating data from stored procedures across multiple schemas
Previous Message Rich Compton 2016-06-01 22:40:13 Aggregating data from stored procedures across multiple schemas