aggregate over tables in different schema

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: aggregate over tables in different schema
Date: 2010-01-10 01:30:15
Message-ID: 20100110023015.3e8f6c07@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've tables in different schemas all with the same name and
structure.
I'd like to compute an aggregate on the union of those tables.
I don't know the schemas in advance.
The list of the schema will be built selecting all the schemas that
contain a table with that name.

Other than building dynamically the statement as a list of union or
building up a view is there any other way?

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-01-10 08:01:57 Re: Optimistic locking with multiple rows
Previous Message Grzegorz Jaśkiewicz 2010-01-10 01:04:49 Re: dynamic insert in plpgsql