When you attempt to create more than 256 databases, it is not possible to create all of them, and the following error is thrown:
PANIC: Out of shared-memory for persistent databaseS (cdbpersistentdatabase.c:528) server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. connection to the server was lost
The three parameters below limit the persistent entries for the number of directories:
The maximum number of database directories is calculated by gp_max_databases * gp_max_tablespaces. The default is 16 * 64, or 256.
Increasing the values of gp_max_database / gp_max_filespace / gp_max_tablespace to 64 on your $MASTER_DATA_DIRECTORY/postgresql.conf file would help you add more databases to your cluster.