single sql, multiple schemas, one result set - Mailing list pgsql-general

From PegoraroF10
Subject single sql, multiple schemas, one result set
Date
Msg-id 1522777660304-0.post@n3.nabble.com
Whole thread Raw
Responses Re: single sql, multiple schemas, one result set
Re: single sql, multiple schemas, one result set
List pgsql-general
Suppose a DB with dozens of schemas with same structure.
DB
  Schema1
    Table1
    Table2
  Schema2
    Table1
    Table2
  Schema3
    Table1
    Table2
Then we want to execute a SQL on specific schemas and the result of it could
be a UNION ALL. So, how could be a function that runs that SQL on each
schema and results just on result set ?

Then I would use something like ...
select * from SQLFromMultipleShema(Array['Schema1,Schema3'],'select count(*)
from Table2');




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


pgsql-general by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: How to get an inclusive interval when using daterange
Next
From: Guyren Howe
Date:
Subject: Re: single sql, multiple schemas, one result set