I want to simulate a distributed database, so I am generating 10 isolated databases, 3 replicas each, for a total of 30 database instances. I am doing this all locally for the moment, and am running something like this:
drop database if exists ddsjs_test_1_replica_1;
drop database if exists ddsjs_test_2_replica_1;
drop database if exists ddsjs_test_3_replica_1;
drop database if exists ddsjs_test_4_replica_1;
drop database if exists ddsjs_test_5_replica_1;
drop database if exists ddsjs_test_6_replica_1;
drop database if exists ddsjs_test_7_replica_1;
drop database if exists ddsjs_test_8_replica_1;
drop database if exists ddsjs_test_9_replica_1;
drop database if exists ddsjs_test_10_replica_1;
create database ddsjs_test_1_replica_1;
create database ddsjs_test_2_replica_1;
create database ddsjs_test_3_replica_1;
create database ddsjs_test_4_replica_1;
create database ddsjs_test_5_replica_1;
create database ddsjs_test_6_replica_1;
create database ddsjs_test_7_replica_1;
create database ddsjs_test_8_replica_1;
create database ddsjs_test_9_replica_1;
create database ddsjs_test_10_replica_1;
...
How do I make this dynamic in SQL for Postgres? Like looping and incrementing i?