I have a web app with thousands of schemas (one per user).
I have seen this post
Hibernate and Multi-Tenant Database using Schemas in PostgreSQL
where it is mentioned the search_path approach to querying a particular table in a schema.
I am wondering how to query all the schema at the same time in postgres?
Do I need to implement a python script (for example) to make queries one by one and then gather the results or can I implement that directly in SQL to gather all the queries?
For example if I want a table with userid and number_of_posts and I want to query these fields on each user with a separate schema, how would i write that in SQL? I don't see how to change the search path in a unique query automatically.
Is there a command in postgres to list all the existing schemas?
Thanks a lot