Created
September 13, 2012 20:54
-
-
Save lucasdavila/3717571 to your computer and use it in GitHub Desktop.
Simple script to run a PostgreSQL query in multitenancy dbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sql="select 1" | |
| for tenant_name in tenant_1 tenant_2 tenant_3 tenant_4 | |
| do | |
| psql -d $tenant_name -c "$sql" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment