Many suggestions for integration testing which includes Postgres Database say that I can initdb
a new whole cluster in RAM disk and work on it.
As far as I understand initdb
is a new folder like thing related to databases.
According to Postgres docs:
initdb
creates a new PostgreSQL database cluster. A database cluster is a collection of databases that are managed by a single server instance.
Does it create a new server? Or a new Database?
Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalogue tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and Postgres databases. When you later create a new database, everything in the template1 database is copied. (Therefore, anything installed in template1 is automatically copied into each database created later.) The Postgres database is a default database meant for use by users, utilities and third party applications.
Does the above sentence mean that from now on whatever database is created it is stored in that new "cluster"? If not how to create tables in such a cluster of RAM disk?
How can I use it to set it up for testing?