I have a problem. The program requires interaction with various databases.
There was an idea to use a singleton, in which there will be a connection and one class will be created, acquire within the limits of the development of the globes and sources to resources, and, therefore, close it in order to acquire a connection without eating a lot of resources.
I haven't found a way to switch between databases on the same user.
That is, a conditionally short question:
How do I create a connection without explicitly specifying a database and then switch between them
PostgreSQL does not support this feature. You always open a connection to a specific database. If you want a different database, you must open a new connection.
I have a problem. The program requires interaction with various databases. There was an idea to use a singleton, in which there will be a connection and one class will be created, acquire within the limits of the development of the globes and sources to resources, and, therefore, close it in order to acquire a connection without eating a lot of resources.
I haven't found a way to switch between databases on the same user. That is, a conditionally short question: How do I create a connection without explicitly specifying a database and then switch between them